| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace app\model\blue;
- use app\extra\basic\Model;
- use think\model\relation\HasOne;
- /**
- * @property integer $id (主键)
- * @property integer $category_id
- * @property string $title
- * @property mixed $banner
- * @property integer $need_num 招募名额
- * @property integer $user_num 报名人数
- * @property integer $sale_price 产品售价
- * @property integer $req_user_level
- * @property integer $req_dy_level
- */
- class BlueTask 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 = "blue_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 getTotalBudgetAttr($val): string
- // {
- // return formatMoneyKw($val);
- // }
- public function getExpirationTimeEndAttr($val): int
- {
- return strtotime($val);
- }
- public function getNeedNumberAttr($val): int
- {
- return $val>0?$val:999;
- }
- public function categoryJoin(): HasOne
- {
- return $this->hasOne(BlueCategory::class,'sign','category');
- }
- public function levelJoin(): HasOne
- {
- return $this->hasOne(BlueExpertLevel::class,'id','level');
- }
- }
|