42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\admin\model\app\physical;
|
|
|
|
use think\Model;
|
|
|
|
class OrderExpress extends Model
|
|
{
|
|
protected $name = 'app_physical_order_express';
|
|
|
|
protected $autoWriteTimestamp = 'integer';
|
|
protected $createTime = 'createtime';
|
|
protected $updateTime = 'updatetime';
|
|
protected $deleteTime = false;
|
|
|
|
protected $append = ['status_text'];
|
|
|
|
public function expressLogs()
|
|
{
|
|
return $this->hasMany('app\admin\model\app\physical\OrderExpressLog', 'order_express_id', 'id');
|
|
}
|
|
|
|
public function getStatusTextAttr($value, $data)
|
|
{
|
|
$statusList = [
|
|
'noinfo' => '暂无信息',
|
|
'collect' => '已揽件',
|
|
'transport' => '运输中',
|
|
'delivery' => '派送中',
|
|
'signfor' => '已签收',
|
|
'refuse' => '用户拒收',
|
|
'difficulty' => '问题件',
|
|
'invalid' => '无效件',
|
|
'timeout' => '超时单',
|
|
'fail' => '签收失败',
|
|
'back' => '退回'
|
|
];
|
|
return $statusList[$data['status']] ?? '';
|
|
}
|
|
|
|
}
|