forms/common/order/CommonOrder.php | ●●●●● patch | view | raw | blame | history | |
forms/mall/order/BaseOrderForm.php | ●●●●● patch | view | raw | blame | history | |
views/components/app-order.php | ●●●●● patch | view | raw | blame | history |
forms/common/order/CommonOrder.php
@@ -173,7 +173,21 @@ ->andWhere(['!=', 'express', '']) ->orderBy(['created_at' => SORT_DESC]) ->one(); return $order ? $order->express : ''; } // 获取最后一次发货的快递数据实体 public function getLastExpressModel() { $order = OrderDetailExpress::find()->andWhere([ 'mall_id' => \Yii::$app->mall->id, 'mch_id' => \Yii::$app->user->identity->mch_id, 'send_type' => 1, ]) ->andWhere(['!=', 'express', '']) ->orderBy(['created_at' => SORT_DESC]) ->one(); //\Yii::warning('快递 数据:'.($order ? $order->express_no : '未发货')); return $order; } } forms/mall/order/BaseOrderForm.php
@@ -146,7 +146,7 @@ ->asArray() ->all(); $lastExpress = (new CommonOrder)->getLastExpress(); //$lastExpress = (new CommonOrder)->getLastExpress(); $userList = User::find()->with(['userInfo', 'userPlatform']) ->where(['id' => array_column($list, 'user_id')]) @@ -278,7 +278,12 @@ $item['new_express_single'] = $order->getExpressSingleList($item); $item['cancel_data'] = $item['cancel_data'] ? json_decode($item['cancel_data'], true) : []; $item['send_template_discount_price'] = price_format($item['total_goods_original_price'] + $item['express_price'] - $item['total_pay_price']); $item['last_express'] = $lastExpress; // 快递信息 //$item['last_express'] = $lastExpress; $lastExpressModel = (new CommonOrder)->getLastExpressModel(); $item['last_express'] = $lastExpressModel?$lastExpressModel->express:''; $item['last_express_no'] = $lastExpressModel?$lastExpressModel->express_no:''; } $menuList = \Yii::$app->role->getShareMenu(); views/components/app-order.php
@@ -491,6 +491,9 @@ <el-tag size="small" type="success" v-if="item.is_sale == 1">已完成</el-tag> <el-tag size="small" type="danger" v-if="item.cancel_status == 1">已取消</el-tag> <el-tag size="small" type="danger" v-else-if="item.cancel_status == 2">申请取消</el-tag> <el-tag size="small" type="danger" v-if="item.is_send == 1 && item.is_confirm == 0"> {{ item.last_express }} : {{ item.last_express_no }} </el-tag> </template> <slot name="orderTag" :order="item"></slot> </div>