| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace app\model\saas;
- use app\extra\basic\Model;
- /**
- * @property integer $id (主键)
- * @property string $name
- * @property integer $sort
- * @property integer $time
- * @property integer $unit 1天2年
- * @property integer $money 金额
- * @property integer $old_money 原价
- * @property integer $status
- * @property mixed $create_at
- */
- class SaasCombo 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 = "saas_combo";
-
- /**
- * 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 getMoneyAttr($data): string
- {
- if (empty($data)) return "0.00";
- return format_money($data/100,2,"");
- }
- public function getOldMoneyAttr($data): string
- {
- if (empty($data)) return "0.00";
- return format_money($data/100,2,"");
- }
- }
|