| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace app\model\wash;
- use app\extra\basic\Model;
- /**
- * @property integer $id (主键)
- * @property string $name
- * @property integer $price
- * @property integer $is_deleted 删除状态
- * @property integer $status 状态
- * @property mixed $create_at 创建时间
- */
- class WashGoods 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_goods";
-
- /**
- * 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));
- }
- }
|