...
|
...
|
@@ -8,13 +8,10 @@ use think\Model; |
|
|
class Order extends Model
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 表名
|
|
|
protected $name = 'order';
|
|
|
|
|
|
|
|
|
// 自动写入时间戳字段
|
|
|
protected $autoWriteTimestamp = 'int';
|
|
|
|
...
|
...
|
@@ -28,9 +25,8 @@ class Order extends Model |
|
|
'order_status_text',
|
|
|
'invoice_status_text'
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function getOrderStatusList()
|
|
|
{
|
|
|
return ['0' => __('Order_status 0'), '1' => __('Order_status 1'), '2' => __('Order_status 2'), '3' => __('Order_status 3')];
|
...
|
...
|
@@ -46,6 +42,14 @@ class Order extends Model |
|
|
return ['0' => __('Ispay 0'), '1' => __('Ispay 1')];
|
|
|
}
|
|
|
|
|
|
|
|
|
public function getIspayTextAttr($value, $data)
|
|
|
{
|
|
|
$value = $value ? $value : (isset($data['ispay']) ? $data['ispay'] : '');
|
|
|
$list = $this->getIspay();
|
|
|
return isset($list[$value]) ? $list[$value] : '';
|
|
|
}
|
|
|
|
|
|
public function getOrderStatusTextAttr($value, $data)
|
|
|
{
|
|
|
$value = $value ? $value : (isset($data['order_status']) ? $data['order_status'] : '');
|
...
|
...
|
@@ -62,8 +66,6 @@ class Order extends Model |
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function user()
|
|
|
{
|
|
|
return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
...
|
...
|
|