Переглянути джерело

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

From-wh 2 роки тому
батько
коміт
48eeed4a27

+ 2 - 2
crmeb/app/adminapi/controller/v1/order/StoreOrder.php

@@ -242,7 +242,7 @@ class StoreOrder extends AuthController
             ['delivery_id', ''],//快递单号
             ['delivery_id', ''],//快递单号
             ['delivery_code', ''],//快递公司编码
             ['delivery_code', ''],//快递公司编码
 
 
-            ['express_record_type', 2],//发货记录类型
+            ['express_record_type', 2],//发货记录类型:2=电子面单;3=商家寄件
             ['express_temp_id', ""],//电子面单模板
             ['express_temp_id', ""],//电子面单模板
             ['to_name', ''],//寄件人姓名
             ['to_name', ''],//寄件人姓名
             ['to_tel', ''],//寄件人电话
             ['to_tel', ''],//寄件人电话
@@ -465,7 +465,7 @@ class StoreOrder extends AuthController
      */
      */
     public function order_info($id)
     public function order_info($id)
     {
     {
-        if (!$id || !($orderInfo = $this->services->get($id, [], ['refund','invoice']))) {
+        if (!$id || !($orderInfo = $this->services->get($id, [], ['refund', 'invoice']))) {
             return app('json')->fail(400118);
             return app('json')->fail(400118);
         }
         }
         /** @var UserServices $services */
         /** @var UserServices $services */

+ 1 - 1
crmeb/app/api/controller/v1/PublicController.php

@@ -217,8 +217,8 @@ class PublicController
     /**
     /**
      * 图片上传
      * 图片上传
      * @param Request $request
      * @param Request $request
+     * @param SystemAttachmentServices $services
      * @return mixed
      * @return mixed
-     * @throws \Psr\SimpleCache\InvalidArgumentException
      */
      */
     public function upload_image(Request $request, SystemAttachmentServices $services)
     public function upload_image(Request $request, SystemAttachmentServices $services)
     {
     {

+ 40 - 1
crmeb/app/api/controller/v1/order/StoreOrderController.php

@@ -255,10 +255,11 @@ class StoreOrderController
         $orderInfo = $this->services->get(['order_id' => $uni]);
         $orderInfo = $this->services->get(['order_id' => $uni]);
         $uid = $type == 1 ? (int)$request->uid() : $orderInfo->uid;
         $uid = $type == 1 ? (int)$request->uid() : $orderInfo->uid;
         $orderInfo->is_channel = $this->getChennel[$request->getFromType()] ?? ($request->isApp() ? 0 : 1);
         $orderInfo->is_channel = $this->getChennel[$request->getFromType()] ?? ($request->isApp() ? 0 : 1);
+        $orderInfo->order_id = $uid != $orderInfo->pay_uid ? app()->make(StoreOrderCreateServices::class)->getNewOrderId('cp') : $uni;
         $orderInfo->pay_uid = $uid;
         $orderInfo->pay_uid = $uid;
         $orderInfo->save();
         $orderInfo->save();
         $orderInfo = $orderInfo->toArray();
         $orderInfo = $orderInfo->toArray();
-        $order = $this->services->get(['order_id' => $uni]);
+        $order = $this->services->get(['order_id' => $orderInfo['order_id']]);
         if (!$order)
         if (!$order)
             return app('json')->fail(410173);
             return app('json')->fail(410173);
         if ($order['paid'])
         if ($order['paid'])
@@ -793,4 +794,42 @@ class StoreOrderController
         $cartProduct['order_id'] = $this->services->value(['id' => $cartInfo['oid']], 'order_id');
         $cartProduct['order_id'] = $this->services->value(['id' => $cartInfo['oid']], 'order_id');
         return app('json')->success($cartProduct);
         return app('json')->success($cartProduct);
     }
     }
+
+    /**
+     * 商家寄件回调
+     * @param Request $request
+     * @return \think\Response
+     * @author 等风来
+     * @email 136327134@qq.com
+     * @date 2023/6/12
+     */
+    public function callBack(Request $request)
+    {
+        $data = $request->postMore([
+            ['t', ''],
+            ['sign', ''],
+            ['type', ''],
+            ['data', ''],
+        ]);
+
+        if (md5(json_encode($data['data']) . $data['t']) != $data['sign']) {
+            return app('json')->fail();
+        }
+
+        switch ($data['type']) {
+            case 'order_success':
+                $update = [
+                    'label' => $data['data']['label'] ?? '',
+                ];
+                if (isset($data['kuaidinum'])) {
+                    $update['delivery_id'] = $data['kuaidinum'];
+                }
+                if (isset($data['task_id'])) {
+                    $this->services->update(['task_id' => $data['task_id']], $update);
+                }
+                break;
+        }
+
+        return app('json')->success();
+    }
 }
 }

+ 1 - 0
crmeb/app/api/route/v1.php

@@ -18,6 +18,7 @@ Route::group(function () {
     Route::any('wechat/serve', 'v1.wechat.WechatController/serve')->option(['real_name' => '公众号服务']);//公众号服务
     Route::any('wechat/serve', 'v1.wechat.WechatController/serve')->option(['real_name' => '公众号服务']);//公众号服务
     Route::any('wechat/miniServe', 'v1.wechat.WechatController/miniServe')->option(['real_name' => '小程序服务']);//公众号服务
     Route::any('wechat/miniServe', 'v1.wechat.WechatController/miniServe')->option(['real_name' => '小程序服务']);//公众号服务
     Route::any('pay/notify/:type', 'v1.PayController/notify')->option(['real_name' => '支付回调']);//支付回调
     Route::any('pay/notify/:type', 'v1.PayController/notify')->option(['real_name' => '支付回调']);//支付回调
+    Route::any('order_call_back', 'v1.order.StoreOrderController/callBack')->option(['real_name' => '商家寄件回调']);//商家寄件回调
     Route::get('get_script', 'v1.PublicController/getScript')->option(['real_name' => '获取统计代码']);//获取统计代码
     Route::get('get_script', 'v1.PublicController/getScript')->option(['real_name' => '获取统计代码']);//获取统计代码
     Route::get('version', 'v1.PublicController/getVersion')->option(['real_name' => '获取代码版本号']);
     Route::get('version', 'v1.PublicController/getVersion')->option(['real_name' => '获取代码版本号']);
 })->option(['mark' => 'serve', 'mark_name' => '服务接口']);
 })->option(['mark' => 'serve', 'mark_name' => '服务接口']);

+ 2 - 2
crmeb/app/dao/article/ArticleCategoryDao.php

@@ -59,7 +59,7 @@ class ArticleCategoryDao extends BaseDao
     public function getArticleCategory()
     public function getArticleCategory()
     {
     {
         return $this->search(['hidden' => 0, 'is_del' => 0, 'status' => 1, 'pid' => 0])->with(['children'])
         return $this->search(['hidden' => 0, 'is_del' => 0, 'status' => 1, 'pid' => 0])->with(['children'])
-            ->order('sort DESC')
+            ->order('sort DESC,id DESC')
             ->field('id,pid,title')
             ->field('id,pid,title')
             ->select()->toArray();
             ->select()->toArray();
     }
     }
@@ -77,7 +77,7 @@ class ArticleCategoryDao extends BaseDao
             ->where('hidden', 0)
             ->where('hidden', 0)
             ->where('is_del', 0)
             ->where('is_del', 0)
             ->where('status', 1)
             ->where('status', 1)
-            ->order('sort DESC')
+            ->order('sort DESC,id DESC')
             ->field('id,pid,title')
             ->field('id,pid,title')
             ->select()->toArray();
             ->select()->toArray();
     }
     }

+ 1 - 1
crmeb/app/dao/diy/PageCategoryDao.php

@@ -47,7 +47,7 @@ class PageCategoryDao extends BaseDao
     {
     {
         return $this->search($where)->field($field)->when($page && $limit, function ($query) use ($page, $limit) {
         return $this->search($where)->field($field)->when($page && $limit, function ($query) use ($page, $limit) {
             $query->page();
             $query->page();
-        })->order('sort desc')->select()->toArray();
+        })->order('sort desc,id DESC')->select()->toArray();
     }
     }
 
 
 }
 }

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

@@ -702,7 +702,7 @@ class StoreOrderDao extends BaseDao
                 $query->field("sum($sumField) as number,FROM_UNIXTIME($group, '$timeUinx') as time");
                 $query->field("sum($sumField) as number,FROM_UNIXTIME($group, '$timeUinx') as time");
                 $query->group("FROM_UNIXTIME($group, '$timeUinx')");
                 $query->group("FROM_UNIXTIME($group, '$timeUinx')");
             })
             })
-            ->order('pay_time ASC')->select()->toArray();
+            ->order('pay_time ASC,id DESC')->select()->toArray();
     }
     }
 
 
     /**时间分组订单数统计
     /**时间分组订单数统计
@@ -730,7 +730,7 @@ class StoreOrderDao extends BaseDao
                 $query->field("count($sumField) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time");
                 $query->field("count($sumField) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time");
                 $query->group("FROM_UNIXTIME(pay_time, '$timeUinx')");
                 $query->group("FROM_UNIXTIME(pay_time, '$timeUinx')");
             })
             })
-            ->order('pay_time ASC')->select()->toArray();
+            ->order('pay_time ASC,id DESC')->select()->toArray();
     }
     }
 
 
     /**时间段支付订单人数
     /**时间段支付订单人数
@@ -773,7 +773,7 @@ class StoreOrderDao extends BaseDao
                 $query->field("count(distinct uid) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time");
                 $query->field("count(distinct uid) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time");
                 $query->group("FROM_UNIXTIME(pay_time, '$timeUinx')");
                 $query->group("FROM_UNIXTIME(pay_time, '$timeUinx')");
             })
             })
-            ->order('pay_time ASC')->select()->toArray();
+            ->order('pay_time ASC,id DESC')->select()->toArray();
     }
     }
 
 
 
 

+ 1 - 1
crmeb/app/dao/shipping/ShippingTemplatesDao.php

@@ -53,7 +53,7 @@ class ShippingTemplatesDao extends BaseDao
      */
      */
     public function getShippingList(array $where, int $page, int $limit)
     public function getShippingList(array $where, int $page, int $limit)
     {
     {
-        return $this->search($where)->order('sort DESC')->page($page, $limit)->select()->toArray();
+        return $this->search($where)->order('sort DESC,id DESC')->page($page, $limit)->select()->toArray();
     }
     }
 
 
     /**
     /**

+ 2 - 2
crmeb/app/dao/system/SystemMenusDao.php

@@ -128,7 +128,7 @@ class SystemMenusDao extends BaseDao
     public function menusSelect(array $where, $type = 1)
     public function menusSelect(array $where, $type = 1)
     {
     {
         if ($type == 1) {
         if ($type == 1) {
-            return $this->search($where)->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC')->select();
+            return $this->search($where)->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC,id DESC')->select();
         } else {
         } else {
             return $this->search($where)->group('pid')->column('pid');
             return $this->search($where)->group('pid')->column('pid');
         }
         }
@@ -143,7 +143,7 @@ class SystemMenusDao extends BaseDao
     public function getSearchList()
     public function getSearchList()
     {
     {
         return $this->search(['is_show' => 1, 'auth_type' => 1, 'is_del' => 0, 'is_show_path' => 0])
         return $this->search(['is_show' => 1, 'auth_type' => 1, 'is_del' => 0, 'is_show_path' => 0])
-            ->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC')->select();
+            ->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC,id DESC')->select();
     }
     }
 
 
     /**
     /**

+ 1 - 1
crmeb/app/dao/system/config/SystemConfigDao.php

@@ -84,7 +84,7 @@ class SystemConfigDao extends BaseDao
     {
     {
         $where['tab_id'] = $tabId;
         $where['tab_id'] = $tabId;
         if ($status == 1) $where['status'] = $status;
         if ($status == 1) $where['status'] = $status;
-        return $this->search($where)->order('sort desc')->select()->toArray();
+        return $this->search($where)->order('sort desc,id DESC')->select()->toArray();
     }
     }
 
 
     /**
     /**

+ 1 - 1
crmeb/app/dao/user/MemberShipDao.php

@@ -50,7 +50,7 @@ class MemberShipDao extends BaseDao
      */
      */
     public function getApiList(array $where)
     public function getApiList(array $where)
     {
     {
-        return $this->search()->where($where)->order('sort desc')->select()->toArray();
+        return $this->search()->where($where)->order('sort desc,id DESC')->select()->toArray();
     }
     }
 
 
 
 

+ 1 - 1
crmeb/app/dao/user/UserAddressDao.php

@@ -44,6 +44,6 @@ class UserAddressDao extends BaseDao
      */
      */
     public function getList(array $where, string $field = '*', int $page, int $limit): array
     public function getList(array $where, string $field = '*', int $page, int $limit): array
     {
     {
-        return $this->search($where)->field($field)->page($page, $limit)->order('is_default DESC')->select()->toArray();
+        return $this->search($where)->field($field)->page($page, $limit)->order('is_default DESC,id DESC')->select()->toArray();
     }
     }
 }
 }

+ 2 - 2
crmeb/app/dao/user/UserLabelCateDao.php

@@ -45,7 +45,7 @@ class UserLabelCateDao extends BaseDao
     {
     {
         return $this->search($where)->when($page && $limit, function ($query) use ($page, $limit) {
         return $this->search($where)->when($page && $limit, function ($query) use ($page, $limit) {
             $query->page($page, $limit);
             $query->page($page, $limit);
-        })->order('sort DESC')->select()->toArray();
+        })->order('sort DESC,id DESC')->select()->toArray();
     }
     }
 
 
     /**
     /**
@@ -59,6 +59,6 @@ class UserLabelCateDao extends BaseDao
     {
     {
         return $this->getModel()->when(count($with), function ($query) use ($with) {
         return $this->getModel()->when(count($with), function ($query) use ($with) {
             $query->with($with);
             $query->with($with);
-        })->order('sort DESC')->select()->toArray();
+        })->order('sort DESC,id DESC')->select()->toArray();
     }
     }
 }
 }

+ 4 - 4
crmeb/app/model/user/User.php

@@ -69,10 +69,10 @@ class User extends BaseModel
         return app('request')->ip();
         return app('request')->ip();
     }
     }
 
 
-    protected function getPhoneAttr($value)
-    {
-        return $value && app('request')->hasMacro('adminInfo') && app('request')->adminInfo()['level'] != 0 ? substr_replace($value, '****', 3, 4) : $value;
-    }
+//    protected function getPhoneAttr($value)
+//    {
+//        return $value && app('request')->hasMacro('adminInfo') && app('request')->adminInfo()['level'] != 0 ? substr_replace($value, '****', 3, 4) : $value;
+//    }
 
 
     /**
     /**
      * 链接会员登陆设置表
      * 链接会员登陆设置表

+ 1 - 1
crmeb/crmeb/services/express/storage/Express.php

@@ -96,7 +96,7 @@ class Express extends BaseExpress
             'send_real_name' => $data['send_real_name'],
             'send_real_name' => $data['send_real_name'],
             'send_phone' => $data['send_phone'],
             'send_phone' => $data['send_phone'],
             'send_address' => $data['send_address'],
             'send_address' => $data['send_address'],
-            'call_back_url' => sys_config(''),
+            'call_back_url' => sys_config('site_url') . '/api/order_call_back',
             'return_type' => $siid ? '10' : '20',
             'return_type' => $siid ? '10' : '20',
             'siid' => $siid,
             'siid' => $siid,
             'tempid' => $data['tempid'],
             'tempid' => $data['tempid'],

+ 1 - 1
crmeb/crmeb/services/upload/storage/Cos.php

@@ -139,7 +139,7 @@ class Cos extends BaseUpload
                 return $this->setError('上传的文件不存在');
                 return $this->setError('上传的文件不存在');
             }
             }
             if ($this->validate) {
             if ($this->validate) {
-                if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+                if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                     return $this->setError('不合法的文件后缀');
                     return $this->setError('不合法的文件后缀');
                 }
                 }
                 if (filesize($fileHandle) > $this->validate['filesize']) {
                 if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Jdoss.php

@@ -129,7 +129,7 @@ class Jdoss extends BaseUpload
             return $this->setError('上传的文件不存在');
             return $this->setError('上传的文件不存在');
         }
         }
         if ($this->validate) {
         if ($this->validate) {
-            if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+            if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                 return $this->setError('不合法的文件后缀');
                 return $this->setError('不合法的文件后缀');
             }
             }
             if (filesize($fileHandle) > $this->validate['filesize']) {
             if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Local.php

@@ -116,7 +116,7 @@ class Local extends BaseUpload
             return $this->setError('上传的文件不存在');
             return $this->setError('上传的文件不存在');
         }
         }
         if ($this->validate) {
         if ($this->validate) {
-            if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+            if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                 return $this->setError('不合法的文件后缀');
                 return $this->setError('不合法的文件后缀');
             }
             }
             if (filesize($fileHandle) > $this->validate['filesize']) {
             if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Obs.php

@@ -59,7 +59,7 @@ class Obs extends BaseUpload
                 return $this->setError('上传的文件不存在');
                 return $this->setError('上传的文件不存在');
             }
             }
             if ($this->validate) {
             if ($this->validate) {
-                if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+                if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                     return $this->setError('不合法的文件后缀');
                     return $this->setError('不合法的文件后缀');
                 }
                 }
                 if (filesize($fileHandle) > $this->validate['filesize']) {
                 if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Oss.php

@@ -130,7 +130,7 @@ class Oss extends BaseUpload
             return $this->setError('上传的文件不存在');
             return $this->setError('上传的文件不存在');
         }
         }
         if ($this->validate) {
         if ($this->validate) {
-            if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+            if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                 return $this->setError('不合法的文件后缀');
                 return $this->setError('不合法的文件后缀');
             }
             }
             if (filesize($fileHandle) > $this->validate['filesize']) {
             if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Qiniu.php

@@ -126,7 +126,7 @@ class Qiniu extends BaseUpload
             return $this->setError('上传的文件不存在');
             return $this->setError('上传的文件不存在');
         }
         }
         if ($this->validate) {
         if ($this->validate) {
-            if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+            if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                 return $this->setError('不合法的文件后缀');
                 return $this->setError('不合法的文件后缀');
             }
             }
             if (filesize($fileHandle) > $this->validate['filesize']) {
             if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Tyoss.php

@@ -58,7 +58,7 @@ class Tyoss extends BaseUpload
                 return $this->setError('上传的文件不存在');
                 return $this->setError('上传的文件不存在');
             }
             }
             if ($this->validate) {
             if ($this->validate) {
-                if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+                if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                     return $this->setError('不合法的文件后缀');
                     return $this->setError('不合法的文件后缀');
                 }
                 }
                 if (filesize($fileHandle) > $this->validate['filesize']) {
                 if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
template/admin/src/pages/notify/smsConfig/index.vue

@@ -137,7 +137,7 @@ export default {
     };
     };
   },
   },
   created() {
   created() {
-    this.onIsLogin();
+    // this.onIsLogin();
   },
   },
   methods: {
   methods: {
     onChangePhone() {
     onChangePhone() {