$orderId, 'uniacid' => UNIACID ])->find(); return $express ? $express->toArray() : null; } /** * 获取物流轨迹 * @param int $expressId 快递包裹ID * @return array */ public function getLogs() { $logs = OrderExpressLog::where([ 'order_express_id' => $this->id, 'uniacid' => UNIACID ])->order('change_date', 'desc') ->select(); if (is_array($logs)) { return $logs; } return $logs->toArray(); } public function getStatusTextAttr($value, $data) { $statusList = [ 'noinfo' => '暂无信息', 'collect' => '已揽件', 'transport' => '运输中', 'delivery' => '派送中', 'signfor' => '已签收', 'refuse' => '用户拒收', 'difficulty' => '问题件', 'invalid' => '无效件', 'timeout' => '超时单', 'fail' => '签收失败', 'back' => '退回' ]; return $statusList[$data['status']] ?? ''; } }