最新服务器上的版本,以后用这个
1、批量发货导入时,增加将erp单号回写到订单表中
2、增加可以按提货卡号查询订单的条件
5 files modified
23 ■■■■■ changed files
forms/common/order/CommonOrder.php 5 ●●●●● patch | view | raw | blame | history
forms/mall/order/BaseOrderForm.php 5 ●●●● patch | view | raw | blame | history
forms/mall/order/OrderSendForm.php 3 ●●●●● patch | view | raw | blame | history
views/components/app-order.php 10 ●●●● patch | view | raw | blame | history
web/statics/text/batch_send_default.xlsx patch | view | raw | blame | history
forms/common/order/CommonOrder.php
@@ -177,17 +177,18 @@
    }
    // 获取最后一次发货的快递数据实体
    public function getLastExpressModel()
    public function getLastExpressModel($order_id)
    {
        $order = OrderDetailExpress::find()->andWhere([
            'mall_id' => \Yii::$app->mall->id,
            'mch_id' => \Yii::$app->user->identity->mch_id,
            'send_type' => 1,
            'order_id' => $order_id,
        ])
            ->andWhere(['!=', 'express', ''])
            ->orderBy(['created_at' => SORT_DESC])
            ->one();
        //\Yii::warning('快递 数据:'.($order ? $order->express_no : '未发货'));
        //\Yii::warning('快递 数据:'.$order_id.'单号:'.$order->express_no);
        return $order;
    }
}
forms/mall/order/BaseOrderForm.php
@@ -282,7 +282,7 @@
            
            // 快递信息
            //$item['last_express'] = $lastExpress;
            $lastExpressModel = (new CommonOrder)->getLastExpressModel();
            $lastExpressModel = (new CommonOrder)->getLastExpressModel($item['id']);
            $item['last_express'] = $lastExpressModel?$lastExpressModel->express:'';
            $item['last_express_no'] = $lastExpressModel?$lastExpressModel->express_no:'';
        }
@@ -686,6 +686,9 @@
                case 'address':
                    $query->andWhere(['like', 'address', $this->keyword]);
                    break;
                case 'ex_card_no':
                    $query->andWhere(['like', 'o.ex_card_no', $this->keyword]);
                    break;
                default:
                    // 门店搜索
                    $storeIds = Store::find()->where(['mall_id' => \Yii::$app->mall->id, 'is_delete' => 0])
forms/mall/order/OrderSendForm.php
@@ -217,6 +217,9 @@
                $order->send_type = 0;
            }
            // ERP单号
            $order->ex_erp_no = $v[3];
            $detailIds = [];
            /** @var OrderDetail $detail */
            $t = \Yii::$app->db->beginTransaction();
views/components/app-order.php
@@ -491,7 +491,7 @@
                                <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">
                                <el-tag size="small" type="danger" v-if="item.is_send == 1">
                                    {{ item.last_express }} : {{ item.last_express_no }}
                                </el-tag>
                            </template>
@@ -1164,16 +1164,17 @@
                type: Array,
                default: function () {
                    return [
                        {value: 'ex_card_no', name: '提货卡号'},
                        {value: '3', name: '收货人'},
                        {value: '6', name: '收货人电话'},
                        {value: 'address', name: '收货地址'},
                        {value: '1', name: '订单号'},
                        {value: '9', name: '商户单号'},
                        {value: '2', name: '用户名'},
                        {value: '4', name: '用户ID'},
                        {value: '5', name: '商品名称'},
                        {value: '3', name: '收货人'},
                        {value: '6', name: '收货人电话'},
                        {value: '7', name: '门店名称'},
                        {value: 'goods_no', name: '商品货号'},
                        {value: 'address', name: '收货地址'},
                    ]
                }
            },
@@ -1780,7 +1781,6 @@
                    params[key] = this.search[key]
                });
                params['flag'] = '';
                request({
                    params: params,
                }).then(e => {
web/statics/text/batch_send_default.xlsx
Binary files differ