46 lines
867 B
PHP
Executable File
46 lines
867 B
PHP
Executable File
<?php
|
|
/**
|
|
* 订单模型
|
|
*/
|
|
|
|
namespace app\common\model;
|
|
|
|
use think\model\concern\SoftDelete;
|
|
|
|
class Order extends Model
|
|
{
|
|
use SoftDelete;
|
|
public $softDelete = true;
|
|
protected $name = 'order';
|
|
protected $autoWriteTimestamp = true;
|
|
|
|
//可搜索字段
|
|
protected $searchField = [];
|
|
|
|
//是否启用获取器
|
|
public function getStatusTextAttr($value, $data)
|
|
{
|
|
return self::BOOLEAN_TEXT[$data['status']];
|
|
}
|
|
|
|
//结束时间获取器
|
|
public function getEndTimeAttr($value)
|
|
{
|
|
return date('Y-m-d H:i:s',$value);
|
|
}
|
|
|
|
//结束时间修改器
|
|
public function setEndTimeAttr($value)
|
|
{
|
|
return strtotime($value);
|
|
}
|
|
|
|
//订单类型
|
|
public function getOrderTypeTextAttr($value, $data)
|
|
{
|
|
return self::ORDER_TEXT[$data['order_type']];
|
|
}
|
|
|
|
|
|
}
|