diff --git a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php index 7d6f50e40..d0ed1fbe8 100644 --- a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php +++ b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php @@ -242,7 +242,7 @@ class StoreOrder extends AuthController ['delivery_id', ''],//快递单号 ['delivery_code', ''],//快递公司编码 - ['express_record_type', 2],//发货记录类型 + ['express_record_type', 2],//发货记录类型:2=电子面单;3=商家寄件 ['express_temp_id', ""],//电子面单模板 ['to_name', ''],//寄件人姓名 ['to_tel', ''],//寄件人电话 @@ -465,7 +465,7 @@ class StoreOrder extends AuthController */ 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); } /** @var UserServices $services */ diff --git a/crmeb/app/api/controller/v1/PublicController.php b/crmeb/app/api/controller/v1/PublicController.php index 377c6c25e..c543d8376 100644 --- a/crmeb/app/api/controller/v1/PublicController.php +++ b/crmeb/app/api/controller/v1/PublicController.php @@ -217,8 +217,8 @@ class PublicController /** * 图片上传 * @param Request $request + * @param SystemAttachmentServices $services * @return mixed - * @throws \Psr\SimpleCache\InvalidArgumentException */ public function upload_image(Request $request, SystemAttachmentServices $services) { diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 613d27b48..5b2ba4b07 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -255,10 +255,11 @@ class StoreOrderController $orderInfo = $this->services->get(['order_id' => $uni]); $uid = $type == 1 ? (int)$request->uid() : $orderInfo->uid; $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->save(); $orderInfo = $orderInfo->toArray(); - $order = $this->services->get(['order_id' => $uni]); + $order = $this->services->get(['order_id' => $orderInfo['order_id']]); if (!$order) return app('json')->fail(410173); if ($order['paid']) @@ -793,4 +794,42 @@ class StoreOrderController $cartProduct['order_id'] = $this->services->value(['id' => $cartInfo['oid']], 'order_id'); 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(); + } } diff --git a/crmeb/app/api/route/v1.php b/crmeb/app/api/route/v1.php index 5aba54cd7..586fe4b64 100644 --- a/crmeb/app/api/route/v1.php +++ b/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/miniServe', 'v1.wechat.WechatController/miniServe')->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('version', 'v1.PublicController/getVersion')->option(['real_name' => '获取代码版本号']); })->option(['mark' => 'serve', 'mark_name' => '服务接口']); diff --git a/crmeb/app/dao/article/ArticleCategoryDao.php b/crmeb/app/dao/article/ArticleCategoryDao.php index dfd266a10..b0734c33b 100644 --- a/crmeb/app/dao/article/ArticleCategoryDao.php +++ b/crmeb/app/dao/article/ArticleCategoryDao.php @@ -59,7 +59,7 @@ class ArticleCategoryDao extends BaseDao public function getArticleCategory() { 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') ->select()->toArray(); } @@ -77,7 +77,7 @@ class ArticleCategoryDao extends BaseDao ->where('hidden', 0) ->where('is_del', 0) ->where('status', 1) - ->order('sort DESC') + ->order('sort DESC,id DESC') ->field('id,pid,title') ->select()->toArray(); } diff --git a/crmeb/app/dao/diy/PageCategoryDao.php b/crmeb/app/dao/diy/PageCategoryDao.php index a147ef424..9a14f7753 100644 --- a/crmeb/app/dao/diy/PageCategoryDao.php +++ b/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) { $query->page(); - })->order('sort desc')->select()->toArray(); + })->order('sort desc,id DESC')->select()->toArray(); } } diff --git a/crmeb/app/dao/order/StoreOrderDao.php b/crmeb/app/dao/order/StoreOrderDao.php index 6a351008a..5c239fb6b 100644 --- a/crmeb/app/dao/order/StoreOrderDao.php +++ b/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->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->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->group("FROM_UNIXTIME(pay_time, '$timeUinx')"); }) - ->order('pay_time ASC')->select()->toArray(); + ->order('pay_time ASC,id DESC')->select()->toArray(); } diff --git a/crmeb/app/dao/shipping/ShippingTemplatesDao.php b/crmeb/app/dao/shipping/ShippingTemplatesDao.php index 66c32e815..42b0a0896 100644 --- a/crmeb/app/dao/shipping/ShippingTemplatesDao.php +++ b/crmeb/app/dao/shipping/ShippingTemplatesDao.php @@ -53,7 +53,7 @@ class ShippingTemplatesDao extends BaseDao */ 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(); } /** diff --git a/crmeb/app/dao/system/SystemMenusDao.php b/crmeb/app/dao/system/SystemMenusDao.php index 952ceee3a..8f39cd767 100644 --- a/crmeb/app/dao/system/SystemMenusDao.php +++ b/crmeb/app/dao/system/SystemMenusDao.php @@ -128,7 +128,7 @@ class SystemMenusDao extends BaseDao public function menusSelect(array $where, $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 { return $this->search($where)->group('pid')->column('pid'); } @@ -143,7 +143,7 @@ class SystemMenusDao extends BaseDao public function getSearchList() { 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(); } /** diff --git a/crmeb/app/dao/system/config/SystemConfigDao.php b/crmeb/app/dao/system/config/SystemConfigDao.php index d093c2c23..8afaf35d0 100644 --- a/crmeb/app/dao/system/config/SystemConfigDao.php +++ b/crmeb/app/dao/system/config/SystemConfigDao.php @@ -84,7 +84,7 @@ class SystemConfigDao extends BaseDao { $where['tab_id'] = $tabId; 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(); } /** diff --git a/crmeb/app/dao/user/MemberShipDao.php b/crmeb/app/dao/user/MemberShipDao.php index a6720c2d4..2ec8fd55b 100644 --- a/crmeb/app/dao/user/MemberShipDao.php +++ b/crmeb/app/dao/user/MemberShipDao.php @@ -50,7 +50,7 @@ class MemberShipDao extends BaseDao */ 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(); } diff --git a/crmeb/app/dao/user/UserAddressDao.php b/crmeb/app/dao/user/UserAddressDao.php index 2ad2d13da..bce2de1cd 100644 --- a/crmeb/app/dao/user/UserAddressDao.php +++ b/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 { - 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(); } } diff --git a/crmeb/app/dao/user/UserLabelCateDao.php b/crmeb/app/dao/user/UserLabelCateDao.php index c5adb29fa..bd192c3da 100644 --- a/crmeb/app/dao/user/UserLabelCateDao.php +++ b/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) { $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) { $query->with($with); - })->order('sort DESC')->select()->toArray(); + })->order('sort DESC,id DESC')->select()->toArray(); } } diff --git a/crmeb/app/model/user/User.php b/crmeb/app/model/user/User.php index 4cfb748d5..a2baa425f 100644 --- a/crmeb/app/model/user/User.php +++ b/crmeb/app/model/user/User.php @@ -69,10 +69,10 @@ class User extends BaseModel 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; +// } /** * 链接会员登陆设置表 diff --git a/crmeb/crmeb/services/express/storage/Express.php b/crmeb/crmeb/services/express/storage/Express.php index 38c7b9b6b..b9258fa45 100644 --- a/crmeb/crmeb/services/express/storage/Express.php +++ b/crmeb/crmeb/services/express/storage/Express.php @@ -96,7 +96,7 @@ class Express extends BaseExpress 'send_real_name' => $data['send_real_name'], 'send_phone' => $data['send_phone'], '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', 'siid' => $siid, 'tempid' => $data['tempid'], diff --git a/crmeb/crmeb/services/upload/storage/Cos.php b/crmeb/crmeb/services/upload/storage/Cos.php index a7ea05bac..3e26b9601 100644 --- a/crmeb/crmeb/services/upload/storage/Cos.php +++ b/crmeb/crmeb/services/upload/storage/Cos.php @@ -139,7 +139,7 @@ class Cos extends BaseUpload return $this->setError('上传的文件不存在'); } 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('不合法的文件后缀'); } if (filesize($fileHandle) > $this->validate['filesize']) { diff --git a/crmeb/crmeb/services/upload/storage/Jdoss.php b/crmeb/crmeb/services/upload/storage/Jdoss.php index b8c5d1f72..71b6b2512 100644 --- a/crmeb/crmeb/services/upload/storage/Jdoss.php +++ b/crmeb/crmeb/services/upload/storage/Jdoss.php @@ -129,7 +129,7 @@ class Jdoss extends BaseUpload return $this->setError('上传的文件不存在'); } 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('不合法的文件后缀'); } if (filesize($fileHandle) > $this->validate['filesize']) { diff --git a/crmeb/crmeb/services/upload/storage/Local.php b/crmeb/crmeb/services/upload/storage/Local.php index 366eb3d62..1c878147e 100644 --- a/crmeb/crmeb/services/upload/storage/Local.php +++ b/crmeb/crmeb/services/upload/storage/Local.php @@ -116,7 +116,7 @@ class Local extends BaseUpload return $this->setError('上传的文件不存在'); } 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('不合法的文件后缀'); } if (filesize($fileHandle) > $this->validate['filesize']) { diff --git a/crmeb/crmeb/services/upload/storage/Obs.php b/crmeb/crmeb/services/upload/storage/Obs.php index c5a9910f5..20b03af90 100644 --- a/crmeb/crmeb/services/upload/storage/Obs.php +++ b/crmeb/crmeb/services/upload/storage/Obs.php @@ -59,7 +59,7 @@ class Obs extends BaseUpload return $this->setError('上传的文件不存在'); } 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('不合法的文件后缀'); } if (filesize($fileHandle) > $this->validate['filesize']) { diff --git a/crmeb/crmeb/services/upload/storage/Oss.php b/crmeb/crmeb/services/upload/storage/Oss.php index f45da416b..012c3d201 100644 --- a/crmeb/crmeb/services/upload/storage/Oss.php +++ b/crmeb/crmeb/services/upload/storage/Oss.php @@ -130,7 +130,7 @@ class Oss extends BaseUpload return $this->setError('上传的文件不存在'); } 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('不合法的文件后缀'); } if (filesize($fileHandle) > $this->validate['filesize']) { diff --git a/crmeb/crmeb/services/upload/storage/Qiniu.php b/crmeb/crmeb/services/upload/storage/Qiniu.php index b9dae7968..1558c50cc 100644 --- a/crmeb/crmeb/services/upload/storage/Qiniu.php +++ b/crmeb/crmeb/services/upload/storage/Qiniu.php @@ -126,7 +126,7 @@ class Qiniu extends BaseUpload return $this->setError('上传的文件不存在'); } 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('不合法的文件后缀'); } if (filesize($fileHandle) > $this->validate['filesize']) { diff --git a/crmeb/crmeb/services/upload/storage/Tyoss.php b/crmeb/crmeb/services/upload/storage/Tyoss.php index 1e90dad7c..2233ba07f 100644 --- a/crmeb/crmeb/services/upload/storage/Tyoss.php +++ b/crmeb/crmeb/services/upload/storage/Tyoss.php @@ -58,7 +58,7 @@ class Tyoss extends BaseUpload return $this->setError('上传的文件不存在'); } 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('不合法的文件后缀'); } if (filesize($fileHandle) > $this->validate['filesize']) { diff --git a/template/admin/src/pages/notify/smsConfig/index.vue b/template/admin/src/pages/notify/smsConfig/index.vue index 40f321d8e..4c4c089cb 100644 --- a/template/admin/src/pages/notify/smsConfig/index.vue +++ b/template/admin/src/pages/notify/smsConfig/index.vue @@ -137,7 +137,7 @@ export default { }; }, created() { - this.onIsLogin(); + // this.onIsLogin(); }, methods: { onChangePhone() {