| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace app\model\wash;
- use app\extra\basic\Model;
- use think\model\relation\HasOne;
- /**
- * @property integer $id (主键)
- * @property integer $store_id
- * @property integer $agent_id
- * @property string $name
- * @property integer $status 状态
- * @property mixed $create_at 创建时间
- */
- class WashType 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 = "wash_type";
-
- /**
- * 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 getPriceAttr($data): int|string
- {
- if (empty($data)) return 0;
- return format_money(($data/100));
- }
- public function agent(): HasOne
- {
- return $this->hasOne("app\model\saas\SaasAgent", "agent_id", "agent_id");
- }
- public function store(): HasOne
- {
- return $this->hasOne("app\model\saas\SaasStore", "store_id", "store_id");
- }
- }
|