Просмотр исходного кода

Merge branch 'v5.0.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v5.0.0dev

From-wh 2 лет назад
Родитель
Сommit
e692cde99c

+ 1 - 1
crmeb/app/dao/order/StoreOrderDao.php

@@ -980,6 +980,6 @@ class StoreOrderDao extends BaseDao
 
 
     public function getSubOrderNotSend(int $pid, int $order_id)
     public function getSubOrderNotSend(int $pid, int $order_id)
     {
     {
-        return $this->getModel()->where('id', $pid)->where('status', '0')->where('id', '<>', $order_id)->count();
+        return $this->getModel()->where('pid', $pid)->where('status', '0')->where('id', '<>', $order_id)->count();
     }
     }
 }
 }

+ 5 - 1
crmeb/app/listener/order/OrderShippingListener.php

@@ -24,12 +24,16 @@ class OrderShippingListener implements ListenerInterface
                 $delivery_mode = 1;
                 $delivery_mode = 1;
                 $is_all_delivered = true;
                 $is_all_delivered = true;
                 if ($order['pid'] > 0) {
                 if ($order['pid'] > 0) {
-                    $order = '';
                     $delivery_mode = 2;
                     $delivery_mode = 2;
                     // 判断订单是否全部发货
                     // 判断订单是否全部发货
                     /** @var StoreOrderServices $orderServices */
                     /** @var StoreOrderServices $orderServices */
                     $orderServices = app()->make(StoreOrderServices::class);
                     $orderServices = app()->make(StoreOrderServices::class);
                     $is_all_delivered = $orderServices->checkSubOrderNotSend((int)$order['pid'], (int)$order['id']);
                     $is_all_delivered = $orderServices->checkSubOrderNotSend((int)$order['pid'], (int)$order['id']);
+                    $p_order = $orderServices->get((int)$order['pid']);
+                    if (!$p_order) {
+                        throw new AdminException('拆单异常');
+                    }
+                    $out_trade_no = $p_order['order_id'];
                 }
                 }
 
 
                 // 整理商品信息
                 // 整理商品信息

+ 4 - 4
crmeb/app/services/order/StoreOrderServices.php

@@ -2498,7 +2498,7 @@ HTML;
         }
         }
         // 判断是否开启小程序订单管理
         // 判断是否开启小程序订单管理
         $orderData['order_shipping_open'] = false;
         $orderData['order_shipping_open'] = false;
-        if (sys_config('order_shipping_open', 0) && MiniOrderService::isManaged()) {
+        if (sys_config('order_shipping_open', 0) && MiniOrderService::isManaged() && $order['channel_type'] == 'routine') {
             $orderData['order_shipping_open'] = true;
             $orderData['order_shipping_open'] = true;
         }
         }
         return $orderData;
         return $orderData;
@@ -2654,15 +2654,15 @@ HTML;
 
 
     /**
     /**
      * 取消商家寄件
      * 取消商家寄件
-     * @author 等风来
-     * @email 136327134@qq.com
-     * @date 2023/5/15
      * @param int $id
      * @param int $id
      * @param string $msg
      * @param string $msg
      * @return array|mixed
      * @return array|mixed
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\db\exception\ModelNotFoundException
+     * @author 等风来
+     * @email 136327134@qq.com
+     * @date 2023/5/15
      */
      */
     public function shipmentCancelOrder(int $id, string $msg)
     public function shipmentCancelOrder(int $id, string $msg)
     {
     {

+ 1 - 4
crmeb/app/services/system/SystemMenusServices.php

@@ -144,14 +144,11 @@ class SystemMenusServices extends BaseServices
     public function createMenusForm(array $formData = [])
     public function createMenusForm(array $formData = [])
     {
     {
         $field[] = Form::input('menu_name', '按钮名称', $formData['menu_name'] ?? '')->required('按钮名称必填');
         $field[] = Form::input('menu_name', '按钮名称', $formData['menu_name'] ?? '')->required('按钮名称必填');
-//        $field[] = Form::select('pid', '父级id', $formData['pid'] ?? 0)->setOptions($this->getFormSelectMenus())->filterable(1);
         $field[] = Form::input('menu_path', '路由名称', $formData['menu_path'] ?? '')->placeholder('请输入前台跳转路由地址')->required('请填写前台路由地址');
         $field[] = Form::input('menu_path', '路由名称', $formData['menu_path'] ?? '')->placeholder('请输入前台跳转路由地址')->required('请填写前台路由地址');
         $field[] = Form::input('unique_auth', '权限标识', $formData['unique_auth'] ?? '')->placeholder('不填写则后台自动生成');
         $field[] = Form::input('unique_auth', '权限标识', $formData['unique_auth'] ?? '')->placeholder('不填写则后台自动生成');
-        $params = $formData['params'] ?? '';
-//        $field[] = Form::input('params', '参数', is_array($params) ? '' : $params)->placeholder('举例:a/123/b/234');
         $field[] = Form::frameInput('icon', '图标', $this->url(config('app.admin_prefix', 'admin') . '/widget.widgets/icon', ['fodder' => 'icon']), $formData['icon'] ?? '')->icon('md-add')->height('505px')->modal(['footer-hide' => true]);
         $field[] = Form::frameInput('icon', '图标', $this->url(config('app.admin_prefix', 'admin') . '/widget.widgets/icon', ['fodder' => 'icon']), $formData['icon'] ?? '')->icon('md-add')->height('505px')->modal(['footer-hide' => true]);
         $field[] = Form::number('sort', '排序', (int)($formData['sort'] ?? 0))->precision(0);
         $field[] = Form::number('sort', '排序', (int)($formData['sort'] ?? 0))->precision(0);
-        $field[] = Form::radio('auth_type', '类型', $formData['auth_type'] ?? 1)->options([['value' => 2, 'label' => '接口'], ['value' => 1, 'label' => '菜单(包含页面按钮)']]);
+        $field[] = Form::radio('auth_type', '类型', $formData['auth_type'] ?? 1)->options([['value' => 1, 'label' => '菜单'], ['value' => 3, 'label' => '按钮']]);
         $field[] = Form::radio('is_show', '权限状态', $formData['is_show'] ?? 1)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]);
         $field[] = Form::radio('is_show', '权限状态', $formData['is_show'] ?? 1)->options([['value' => 1, 'label' => '开启'], ['value' => 0, 'label' => '关闭']]);
         $field[] = Form::radio('is_show_path', '是否显示', $formData['is_show_path'] ?? 0)->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]);
         $field[] = Form::radio('is_show_path', '是否显示', $formData['is_show_path'] ?? 0)->options([['value' => 1, 'label' => '显示'], ['value' => 0, 'label' => '隐藏']]);
         [$menuList, $data] = $this->getFormCascaderMenus((int)($formData['pid'] ?? 0));
         [$menuList, $data] = $this->getFormCascaderMenus((int)($formData['pid'] ?? 0));

+ 1 - 2
crmeb/crmeb/services/easywechat/orderShipping/MiniOrderService.php

@@ -111,9 +111,8 @@ class MiniOrderService
      * 判断是否开通
      * 判断是否开通
      * @return bool
      * @return bool
      * @throws HttpException
      * @throws HttpException
-     * @throws \Psr\SimpleCache\InvalidArgumentException
      *
      *
-     * @date 2023/05/09
+     * @date 2023/05/17
      * @author yyw
      * @author yyw
      */
      */
     public static function isManaged()
     public static function isManaged()

+ 8 - 9
crmeb/crmeb/services/easywechat/orderShipping/OrderClient.php

@@ -13,6 +13,8 @@ class OrderClient extends BaseOrder
 {
 {
     const redis_prefix = 'mimi_order';
     const redis_prefix = 'mimi_order';
 
 
+    const express_company = 'ZTO';   // 默认发货快递公司为(中通快递)
+
 
 
     /**
     /**
      * @var \Redis
      * @var \Redis
@@ -70,13 +72,9 @@ class OrderClient extends BaseOrder
      */
      */
     public function shippingByTradeNo(string $out_trade_no, int $logistics_type, array $shipping_list, string $payer_openid, int $delivery_mode = 1, bool $is_all_delivered = true)
     public function shippingByTradeNo(string $out_trade_no, int $logistics_type, array $shipping_list, string $payer_openid, int $delivery_mode = 1, bool $is_all_delivered = true)
     {
     {
-//        $this->setMesJumpPath('demo');
-
-//        if (!$this->checkManaged()) {
-//            throw new AdminException('开通小程序订单管理服务后重试');
-//        }
-
-
+        if (!$this->checkManaged()) {
+            throw new AdminException('开通小程序订单管理服务后重试');
+        }
         $params = [
         $params = [
             'order_key' => [
             'order_key' => [
                 'order_number_type' => 1,
                 'order_number_type' => 1,
@@ -264,14 +262,15 @@ class OrderClient extends BaseOrder
         if (!$this->getRedis()->exists($key)) {
         if (!$this->getRedis()->exists($key)) {
             $date = $this->setDeliveryList();
             $date = $this->setDeliveryList();
             if (!isset($date[$company_name])) {
             if (!isset($date[$company_name])) {
-                throw new AdminException('物流公司异常1');
+//                throw new AdminException('物流公司异常1');
             }
             }
             $express_company = $date[$company_name];
             $express_company = $date[$company_name];
         } else {
         } else {
             $express_company = $this->getRedis()->hMGet($key, [$company_name])[$company_name] ?? '';
             $express_company = $this->getRedis()->hMGet($key, [$company_name])[$company_name] ?? '';
         }
         }
         if (empty($express_company)) {
         if (empty($express_company)) {
-            throw new AdminException('物流公司异常2');
+//            throw new AdminException('物流公司异常2');
+            $express_company = self::express_company;
         }
         }
 
 
         return $express_company;
         return $express_company;

+ 3 - 2
template/admin/src/pages/setting/systemMenus/index.vue

@@ -44,7 +44,7 @@
         <vxe-table-column field="menu_name" tree-node title="按钮名称" min-width="100"></vxe-table-column>
         <vxe-table-column field="menu_name" tree-node title="按钮名称" min-width="100"></vxe-table-column>
         <vxe-table-column field="menu_path" title="路径" min-width="240" tooltip="true">
         <vxe-table-column field="menu_path" title="路径" min-width="240" tooltip="true">
           <template v-slot="{ row }">
           <template v-slot="{ row }">
-            <span v-if="row.auth_type == 1">页面路径:{{ row.menu_path }}</span>
+            <span v-if="row.auth_type == 1">页面:{{ row.menu_path }}</span>
             <span v-if="row.auth_type == 2">按钮:[{{ row.methods }}]{{ row.api_url }}</span>
             <span v-if="row.auth_type == 2">按钮:[{{ row.methods }}]{{ row.api_url }}</span>
           </template>
           </template>
         </vxe-table-column>
         </vxe-table-column>
@@ -58,6 +58,7 @@
               :false-value="0"
               :false-value="0"
               @on-change="onchangeIsShow(row)"
               @on-change="onchangeIsShow(row)"
               size="large"
               size="large"
+              v-if="row.auth_type == 1"
             >
             >
               <span slot="open">显示</span>
               <span slot="open">显示</span>
               <span slot="close">隐藏</span>
               <span slot="close">隐藏</span>
@@ -176,7 +177,7 @@ export default {
       roleData: {
       roleData: {
         is_show: 1,
         is_show: 1,
         keyword: '',
         keyword: '',
-        auth_type: 1,
+        // auth_type: 1,
       },
       },
       defaultProps: {
       defaultProps: {
         children: 'children',
         children: 'children',