| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <?php
- namespace app\model\saas;
- use app\extra\basic\Model;
- use think\model\relation\HasOne;
- /**
- * @property integer $id (主键)
- * @property string $open_id
- * @property integer $agent_id 代理id
- * @property integer $store_id 店铺id
- * @property string $order_id
- * @property string $product_name
- * @property integer $out_id 来客商品ID
- * @property integer $order_amount 订单金额
- * @property integer $pay_amount 实际支付金额
- * @property mixed $pay_at 支付时间
- * @property mixed $refund_at 退款时间
- * @property mixed $refund_apply_at 退款申请时间
- * @property integer $intention_poi_id 下单门店
- * @property string $mobile
- * @property integer $count
- * @property integer $status
- * @property integer $is_send 1已发送过短信
- * @property string $remark
- * @property mixed $create_at
- */
- class SaasOrderLife 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_order_life";
-
- /**
- * 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 getOrderAmountAttr($data): string
- {
- if ($data == 0) return 0;
- return format_money($data/100);
- }
- public function getPayAmountAttr($data): string
- {
- if ($data == 0) return 0;
- return format_money($data/100);
- }
- public function store(): HasOne
- {
- return $this->hasOne("app\model\saas\SaasStore","store_id","store_id");
- }
- public function agent(): HasOne
- {
- return $this->hasOne("app\model\saas\SaasAgent","agent_id","agent_id");
- }
- }
|