| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- declare(strict_types=1);
- namespace App\Model;
- /**
- * 充电站点订单自动补充任务
- */
- class RRobotAutoOrderModel extends Model
- {
- /**
- * The connection name for the model.
- */
- protected ?string $connection = 'robot';
- /**
- * The table associated with the model.
- */
- protected ?string $table = 'r_robot_auto_order';
- public bool $timestamps = true;
- /**
- * The name of the "created at" column.
- *
- * @var null|string
- */
- public const CREATED_AT = 'create_time';
- /**
- * The name of the "updated at" column.
- *
- * @var null|string
- */
- public const UPDATED_AT = 'update_time';
- /**
- * The attributes that are mass assignable.
- */
- protected array $fillable = [];
- /**
- * The attributes that should be cast to native types.
- */
- protected array $casts = [];
- //对应机器人
- public function robot(): \Hyperf\Database\Model\Relations\HasOne
- {
- return $this->hasOne(RRobotModel::class, 'id', 'robot_id')->where('del_flag', 0);
- }
- //对应站点
- public function site(): \Hyperf\Database\Model\Relations\HasOne
- {
- return $this->hasOne(RRobotModel::class, 'id', 'site_id')->where('del_flag', 0);
- }
- //对应站点单价
- public function price(): \Hyperf\Database\Model\Relations\HasMany
- {
- return $this->hasMany(RSitePriceModel::class, 'site_id', 'site_id')->where('del_flag', 0);
- }
- }
|