| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace app\model\cutter;
- use app\extra\basic\Model;
- use app\model\kefu\Kefu;
- use app\model\user\UserLevel;
- use think\model\relation\HasMany;
- use think\model\relation\HasOne;
- /**
- * 任务
- */
- class CutterTask extends Model
- {
- /**
- * The connection name for the model.
- *
- * @var string|null
- */
- protected $connection = 'mysql';
-
- /**
- * The table associated with the model.
- *
- * @var string
- */
- protected string $table = "cutter_task";
-
- /**
- * The primary key associated with the table.
- *
- * @var string
- */
- protected string $primaryKey = "id";
-
- /**
- * Indicates if the model should be timestamped.
- *
- * @var bool
- */
- public bool $timestamps = false;
- public function kefu(): HasOne
- {
- return $this->hasOne(Kefu::class,"id","kefu_id")->where('is_del',0);
- }
- public function orderCount(): HasMany
- {
- return $this->hasMany(CutterOrder::class,"task_id","id");
- }
- public function UserOrder(): HasOne
- {
- return $this->hasOne(CutterOrder::class,"task_id","id");
- }
- public function grade(): HasOne
- {
- return $this->hasOne(UserLevel::class,"grade","grade");
- }
- public function label(): HasOne
- {
- return $this->hasOne(CutterLabel::class,"id","label_id");
- }
- }
|