|
@@ -336,9 +336,9 @@ class OrderLogic extends BaseLogic
|
|
|
$rs = MasterOrderModel::alias('a')
|
|
|
->field('a.id,a.masterOrderCode,a.amount,a.status,a.addtime,c.contactor,c.mobile,c.addr,c.addr_code,a.transaction_id,a.remark')
|
|
|
->leftJoin('addr c', 'c.id=a.addr_id AND c.is_del=' . CommonModel::$del_normal)
|
|
|
- ->append(['order_list'])
|
|
|
+ ->append(['order_list', 'express_data'])
|
|
|
->withAttr('order_list', function ($val, $da) {
|
|
|
- return OrderModel::field('id,orderCode,child_title,child_cover,price,num,total_price')
|
|
|
+ return OrderModel::field('id,orderCode,child_title,child_cover,price,num,total_price,post_code')
|
|
|
->where(['is_del' => CommonModel::$del_normal, 'masterOrderCode' => $da['masterOrderCode'], 'uid' => self::$aid])
|
|
|
->order('id')
|
|
|
->select()
|
|
@@ -346,8 +346,7 @@ class OrderLogic extends BaseLogic
|
|
|
})
|
|
|
->withAttr('addr', function ($val, $da) {
|
|
|
return $da['addr_code'] ? get_addr_name($da['addr_code']) . $val : $val;
|
|
|
- })
|
|
|
- ->where('a.id', $id)
|
|
|
+ })->where('a.id', $id)
|
|
|
->findOrEmpty()
|
|
|
->toArray();
|
|
|
|
|
@@ -355,5 +354,20 @@ class OrderLogic extends BaseLogic
|
|
|
|
|
|
}
|
|
|
|
|
|
+ //物流信息
|
|
|
+ public static function express(string $post_code = ''): Json
|
|
|
+ {
|
|
|
+
|
|
|
+ $res = Db::name('express_data')
|
|
|
+ ->where('post_code', $post_code)
|
|
|
+ ->field(true)
|
|
|
+ ->withAttr('post_data', function ($val) {
|
|
|
+ return json_decode($val, true);
|
|
|
+ })
|
|
|
+ ->findOrEmpty();
|
|
|
+
|
|
|
+ return json_show(CommonModel::$success, '获取快递单号的物流信息成功', $res);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|