1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\common\model;
- use think\Model;
- /**
- * 模型
- */
- class OrderExpress extends Model
- {
- protected $name = 'shop_order_express';
- protected $type = [
- 'ext' => 'json'
- ];
- // 追加属性
- protected $append = [
- 'status_text'
- ];
- public function statusList()
- {
- return [
- 'noinfo' => '暂无信息',
- 'collect' => '已揽件',
- 'transport' => '运输中',
- 'delivery' => '派送中',
- 'signfor' => '已签收',
- 'refuse' => '用户拒收',
- 'difficulty' => '问题件',
- 'invalid' => '无效件',
- 'timeout' => '超时单',
- 'fail' => '签收失败',
- 'back' => '退回',
- ];
- }
- public function items()
- {
- return $this->hasMany(OrderGoods::class, 'order_express_id', 'id');
- }
- public function logs()
- {
- return $this->hasMany(OrderExpressLog::class, 'order_express_id', 'id')->order('id', 'desc');
- }
- }
|