From 59954823855ed8d8cae22ac2499d50088556c727 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 13 Jun 2023 11:04:39 +0800 Subject: [PATCH 01/19] =?UTF-8?q?=E4=B8=80=E5=8F=B7=E9=80=9A=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BC=A0=E5=85=A5appid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/message/notice/SmsService.php | 6 +++--- .../order/StoreOrderDeliveryServices.php | 7 +++++-- .../product/product/CopyTaobaoServices.php | 2 +- .../app/services/shipping/ExpressServices.php | 2 +- .../services/copyproduct/storage/Copy.php | 6 ++++-- .../services/express/storage/Express.php | 20 ++++++++++++++----- .../crmeb/services/sms/storage/Yihaotong.php | 14 +++++++------ 7 files changed, 37 insertions(+), 20 deletions(-) diff --git a/crmeb/app/services/message/notice/SmsService.php b/crmeb/app/services/message/notice/SmsService.php index e24791998..cf83e9ca3 100644 --- a/crmeb/app/services/message/notice/SmsService.php +++ b/crmeb/app/services/message/notice/SmsService.php @@ -66,12 +66,12 @@ class SmsService extends NoticeService $this->isOpen = $this->noticeInfo['is_sms'] === 1; $mark = $this->noticeInfo['mark']; if ($this->isOpen) { - try{ + try { /** @var SmsService $smsServices */ $smsServices = app()->make(SmsService::class); $smsServices->send(true, $phone, $data, $mark); return true; - }catch (\Throwable $e) { + } catch (\Throwable $e) { Log::error('发送短信失败,失败原因:' . $e->getMessage()); } //SmsJob::dispatch('doJob', [$phone, $data, $mark]); @@ -111,7 +111,7 @@ class SmsService extends NoticeService } $smsMake = $services->sms($type); //发送短信 - $res = $smsMake->send($phone, $templateId, $data); + $res = $smsMake->send($phone, $templateId, $data, sys_config('yihaotong_sms_appid', '')); if ($res === false) { throw new ApiException($smsMake->getError()); } diff --git a/crmeb/app/services/order/StoreOrderDeliveryServices.php b/crmeb/app/services/order/StoreOrderDeliveryServices.php index f3ee7d921..1b723f21c 100644 --- a/crmeb/app/services/order/StoreOrderDeliveryServices.php +++ b/crmeb/app/services/order/StoreOrderDeliveryServices.php @@ -518,7 +518,7 @@ class StoreOrderDeliveryServices extends BaseServices if (!sys_config('config_export_open', 0)) { throw new AdminException(400528); } - $dump = $expressService->express()->dump($expData); + $dump = $expressService->express()->dump($expData, sys_config('yihaotong_face_appid', '')); $orderInfo->delivery_id = $dump['kuaidinum']; $data['express_dump'] = json_encode([ 'com' => $expData['com'], @@ -561,10 +561,13 @@ class StoreOrderDeliveryServices extends BaseServices $expData['temp_id'] = $data['express_temp_id']; $expData['weight'] = $this->getOrderSumWeight($id); $expData['cargo'] = $orderInfoServices->getCarIdByProductTitle((int)$orderInfo->id, true); + $expData['day_type'] = $data['day_type']; + $expData['pickup_start_time'] = $data['pickup_start_time']; + $expData['pickup_end_time'] = $data['pickup_end_time']; if (!sys_config('config_shippment_open', 0)) { throw new AdminException('商家寄件未开启无法寄件'); } - $dump = $expressService->express()->shippmentCreateOrder($expData); + $dump = $expressService->express()->shippmentCreateOrder($expData, sys_config('yihaotong_send_appid', '')); $orderInfo->delivery_id = $dump['kuaidinum'] ?? ''; $data['express_dump'] = json_encode([ 'com' => $expData['com'], diff --git a/crmeb/app/services/product/product/CopyTaobaoServices.php b/crmeb/app/services/product/product/CopyTaobaoServices.php index 6a9a4cf07..65e911a56 100644 --- a/crmeb/app/services/product/product/CopyTaobaoServices.php +++ b/crmeb/app/services/product/product/CopyTaobaoServices.php @@ -55,7 +55,7 @@ class CopyTaobaoServices extends BaseServices case 1://平台 /** @var ServeServices $services */ $services = app()->make(ServeServices::class); - $resultData = $services->copy('copy')->goods($url); + $resultData = $services->copy('copy')->goods($url, sys_config('yihaotong_copy_appid', '')); if (isset($resultData['description_image']) && is_string($resultData['description_image'])) { $resultData['description_image'] = json_decode($resultData['description_image'], true); } diff --git a/crmeb/app/services/shipping/ExpressServices.php b/crmeb/app/services/shipping/ExpressServices.php index 1f94584ef..1522c0ced 100644 --- a/crmeb/app/services/shipping/ExpressServices.php +++ b/crmeb/app/services/shipping/ExpressServices.php @@ -203,7 +203,7 @@ class ExpressServices extends BaseServices case 1: /** @var ServeServices $services */ $services = app()->make(ServeServices::class); - $result = $services->express()->query($expressNum, $com, $phone); + $result = $services->express()->query($expressNum, $com, $phone, sys_config('yihaotong_express_appid', '')); if (isset($result['ischeck']) && $result['ischeck'] == 1) { $cacheTime = 0; } else { diff --git a/crmeb/crmeb/services/copyproduct/storage/Copy.php b/crmeb/crmeb/services/copyproduct/storage/Copy.php index 4a4d4a7e5..5308de528 100644 --- a/crmeb/crmeb/services/copyproduct/storage/Copy.php +++ b/crmeb/crmeb/services/copyproduct/storage/Copy.php @@ -49,12 +49,14 @@ class Copy extends BaseCopyProduct /** 复制商品 * @param string $url * @param array $options + * @param string $yihaotongCopyAppid * @return mixed */ - public function goods(string $url, array $options = []) + public function goods(string $url, array $options = [], string $yihaotongCopyAppid = '') { $param['url'] = $url; - return $this->accessToken->httpRequest(self::PRODUCT_GOODS, $param); + $header = $yihaotongCopyAppid != '' ? ['AppId:' . $yihaotongCopyAppid] : []; + return $this->accessToken->httpRequest(self::PRODUCT_GOODS, $param, 'post', true, $header); } diff --git a/crmeb/crmeb/services/express/storage/Express.php b/crmeb/crmeb/services/express/storage/Express.php index b9258fa45..cd4dc4800 100644 --- a/crmeb/crmeb/services/express/storage/Express.php +++ b/crmeb/crmeb/services/express/storage/Express.php @@ -85,7 +85,7 @@ class Express extends BaseExpress * @email 136327134@qq.com * @date 2023/5/15 */ - public function shippmentCreateOrder(array $data) + public function shippmentCreateOrder(array $data, string $yihaotongSendAppid = '') { $siid = sys_config('config_export_siid'); $param = [ @@ -102,8 +102,12 @@ class Express extends BaseExpress 'tempid' => $data['tempid'], 'cargo' => $data['cargo'], 'weight' => $data['weight'], + 'day_type' => $data['day_type'], + 'pickup_start_time' => $data['pickup_start_time'], + 'pickup_end_time' => $data['pickup_end_time'], ]; - return $this->accessToken->httpRequest(self::SHIPMENT_CREATE_ORDER, $param); + $header = $yihaotongSendAppid != '' ? ['AppId:' . $yihaotongSendAppid] : []; + return $this->accessToken->httpRequest(self::SHIPMENT_CREATE_ORDER, $param, 'post', true, $header); } /** @@ -202,7 +206,7 @@ class Express extends BaseExpress * @return 物流状态:status 0在途,1揽收,2疑难,3签收,4退签,5派件,6退回,7转单,10待清关,11清关中,12已清关,13清关异常,14收件人拒签 * @return 物流详情 content */ - public function query(string $num, string $com = '', $phone = '') + public function query(string $num, string $com = '', $phone = '', $yihaotongExpressAppid = '') { $param = [ 'com' => $com, @@ -212,15 +216,20 @@ class Express extends BaseExpress if ($com === null) { unset($param['com']); } - return $this->accessToken->httpRequest(self::EXPRESS_QUERY, $param); + $header = $yihaotongExpressAppid != '' ? ['AppId:' . $yihaotongExpressAppid] : []; + return $this->accessToken->httpRequest(self::EXPRESS_QUERY, $param, 'post', true, $header); } /** * 电子面单打印 * @param array $data 必需参数: com(快递公司编码)、to_name(寄件人)、to_tel(寄件人电话)、to_addr(寄件人详细地址)、from_name(收件人)、from_tel(收件人电话)、from_addr(收件人地址)、temp_id(电子面单模板ID)、siid(云打印机编号)、count(商品数量) + * @param string $yihaotongFaceAppid * @return bool|mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ - public function dump($data) + public function dump($data, $yihaotongFaceAppid = '') { $param = $data; $param['com'] = $data['com'] ?? ''; @@ -264,6 +273,7 @@ class Express extends BaseExpress if (!sys_config('config_export_siid')) { $header = ['version:v1.1']; } + $header = array_merge($header, $yihaotongFaceAppid != '' ? ['AppId:' . $yihaotongFaceAppid] : []); return $this->accessToken->httpRequest(self::EXPRESS_DUMP, $param, 'POST', true, $header); } diff --git a/crmeb/crmeb/services/sms/storage/Yihaotong.php b/crmeb/crmeb/services/sms/storage/Yihaotong.php index 8ecd95beb..5df856ef6 100644 --- a/crmeb/crmeb/services/sms/storage/Yihaotong.php +++ b/crmeb/crmeb/services/sms/storage/Yihaotong.php @@ -196,26 +196,28 @@ class Yihaotong extends BaseSms /** * 发送短信 - * @param $phone - * @param $template - * @param $param + * @param string $phone + * @param string $templateId + * @param array $data + * @param string $yihaotongSmsAppid * @return bool|string */ - public function send(string $phone, string $templateId, array $data = []) + public function send(string $phone, string $templateId, array $data = [], string $yihaotongSmsAppid = '') { if (!$phone) { throw new AdminException(400719); } $param = [ 'phone' => $phone, - 'host' => request()->host() + 'host' => request()->host() ]; $param['temp_id'] = $templateId; if (is_null($param['temp_id'])) { throw new AdminException(400720); } $param['param'] = json_encode($data); - return $this->accessToken->httpRequest(self::SMS_SEND, $param); + $header = $yihaotongSmsAppid != '' ? ['AppId:' . $yihaotongSmsAppid] : []; + return $this->accessToken->httpRequest(self::SMS_SEND, $param, 'post', true, $header); } /** From 7286d152091243c9a73bb9b1664430cfdfabb137 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 13 Jun 2023 15:13:47 +0800 Subject: [PATCH 02/19] =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=AE=9D=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/pay/OrderPayServices.php | 6 +++--- crmeb/crmeb/services/pay/storage/AliPay.php | 2 +- template/uni-app/pages/goods/cashier/index.vue | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crmeb/app/services/pay/OrderPayServices.php b/crmeb/app/services/pay/OrderPayServices.php index 4e36f12f9..03bf7f224 100644 --- a/crmeb/app/services/pay/OrderPayServices.php +++ b/crmeb/app/services/pay/OrderPayServices.php @@ -106,7 +106,7 @@ class OrderPayServices */ public function beforePay(array $orderInfo, string $payType, array $options = []) { - $wehcat = $payType == PayServices::WEIXIN_PAY; + $wechat = $payType == PayServices::WEIXIN_PAY; $payType = $this->getPayType($payType); @@ -136,8 +136,8 @@ class OrderPayServices $options['openid'] = $openid; break; case PayServices::ALLIN_PAY: - if ($wehcat) { - $options['wechat'] = $wehcat; + if ($wechat) { + $options['wechat'] = $wechat; } break; } diff --git a/crmeb/crmeb/services/pay/storage/AliPay.php b/crmeb/crmeb/services/pay/storage/AliPay.php index 492513b23..483fc3566 100644 --- a/crmeb/crmeb/services/pay/storage/AliPay.php +++ b/crmeb/crmeb/services/pay/storage/AliPay.php @@ -50,7 +50,7 @@ class AliPay extends BasePay implements PayInterface $code = true; } - return AliPayService::instance()->create($body, $orderId, $totalFee, $attach, $options['uitUrl'] ?? '', $options['siteUrl'] ?? '', $code); + return AliPayService::instance()->create($body, $orderId, $totalFee, $attach, $options['quitUrl'] ?? '', $options['siteUrl'] ?? '', $code); } /** diff --git a/template/uni-app/pages/goods/cashier/index.vue b/template/uni-app/pages/goods/cashier/index.vue index abbd3aa12..64f26b8ad 100644 --- a/template/uni-app/pages/goods/cashier/index.vue +++ b/template/uni-app/pages/goods/cashier/index.vue @@ -293,7 +293,7 @@ // #endif }).then(res => { let status = res.data.status, - orderId = res.data.result.orderId, + orderId = res.data.result.order_id, jsConfig = res.data.result.jsConfig, goPages = '/pages/goods/order_pay_status/index?order_id=' + this.orderId + '&msg=' + res @@ -336,7 +336,7 @@ } }) this.jumpData = { - orderId: res.data.result.orderId, + orderId: res.data.result.order_id, msg: res.msg, } // #endif From 92eb6f3f0724624c7219132107a876533d3b7e20 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Tue, 13 Jun 2023 15:43:18 +0800 Subject: [PATCH 03/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E4=BA=91=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/v1/product/StoreProduct.php | 16 ++++++++++++++-- crmeb/crmeb/services/upload/storage/Jdoss.php | 9 +++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/product/StoreProduct.php b/crmeb/app/adminapi/controller/v1/product/StoreProduct.php index 8b979454b..aaa020ed7 100644 --- a/crmeb/app/adminapi/controller/v1/product/StoreProduct.php +++ b/crmeb/app/adminapi/controller/v1/product/StoreProduct.php @@ -19,6 +19,7 @@ use app\services\product\product\StoreProductServices; use crmeb\services\FileService; use app\services\other\UploadService; use think\facade\App; +use think\Request; /** * Class StoreProduct @@ -339,10 +340,21 @@ class StoreProduct extends AuthController * @return mixed * @throws \Exception */ - public function getTempKeys() + public function getTempKeys(Request $request) { $upload = UploadService::init(); - $re = $upload->getTempKeys(); + $type = (int)sys_config('upload_type', 1); + $key = $request->get('key', ''); + $path = $request->get('path', ''); + $contentType = $request->get('contentType', ''); + if ($type === 5) { + if (!$key || !$contentType) { + return app('json')->fail('缺少参数'); + } + $re = $upload->getTempKeys($key, $path, $contentType); + } else { + $re = $upload->getTempKeys(); + } return $re ? app('json')->success($re) : app('json')->fail(100016); } diff --git a/crmeb/crmeb/services/upload/storage/Jdoss.php b/crmeb/crmeb/services/upload/storage/Jdoss.php index 71b6b2512..d712513fa 100644 --- a/crmeb/crmeb/services/upload/storage/Jdoss.php +++ b/crmeb/crmeb/services/upload/storage/Jdoss.php @@ -345,17 +345,18 @@ class Jdoss extends BaseUpload * 获取OSS上传密钥 * @return mixed|void */ - public function getTempKeys($key = '', $path = '', $expires = '+10 minutes') + public function getTempKeys($key = '', $path = '', $contentType = '', $expires = '+10 minutes') { try { $app = $this->app(); - $cmd = $app->getCommand([ + $cmd = $app->getCommand( 'PutObject', [ 'Bucket' => $this->storageName, 'Key' => $key, - 'SourceFile' => $path + 'SourceFile' => $path, + 'ContentType' => $contentType ] - ]); + ); $request = $app->createPresignedRequest($cmd, $expires); return (string)$request->getUri(); } catch (\Throwable $e) { From 63527e0fa092c38c4aeb559bf2ecdc547b5f5d3f Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Tue, 13 Jun 2023 16:21:47 +0800 Subject: [PATCH 04/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/product/StoreProduct.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crmeb/app/adminapi/controller/v1/product/StoreProduct.php b/crmeb/app/adminapi/controller/v1/product/StoreProduct.php index aaa020ed7..aae882592 100644 --- a/crmeb/app/adminapi/controller/v1/product/StoreProduct.php +++ b/crmeb/app/adminapi/controller/v1/product/StoreProduct.php @@ -351,7 +351,8 @@ class StoreProduct extends AuthController if (!$key || !$contentType) { return app('json')->fail('缺少参数'); } - $re = $upload->getTempKeys($key, $path, $contentType); + $url = $upload->getTempKeys($key, $path, $contentType); + $re = ['url' => $url]; } else { $re = $upload->getTempKeys(); } From fbe9a80577e3bc7e30c56505680ababffa2365e2 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 13 Jun 2023 16:52:39 +0800 Subject: [PATCH 05/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adminapi/controller/PublicController.php | 28 +++++++++++++++++++ .../controller/v1/file/SystemAttachment.php | 15 ++++++++++ crmeb/app/adminapi/route/file.php | 3 ++ crmeb/app/adminapi/route/route.php | 4 +++ 4 files changed, 50 insertions(+) diff --git a/crmeb/app/adminapi/controller/PublicController.php b/crmeb/app/adminapi/controller/PublicController.php index 312ee8c1b..854fec012 100644 --- a/crmeb/app/adminapi/controller/PublicController.php +++ b/crmeb/app/adminapi/controller/PublicController.php @@ -12,6 +12,8 @@ namespace app\adminapi\controller; +use app\Request; +use app\services\system\attachment\SystemAttachmentServices; use crmeb\services\CacheService; use think\Response; @@ -44,4 +46,30 @@ class PublicController { return app('json')->success(getWorkerManUrl()); } + + /** + * 扫码上传 + * @param Request $request + * @param int $upload_type + * @param int $type + * @return Response + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/06/13 + */ + public function scanUpload(Request $request, $upload_type = 0, $type = 0) + { + [$pid, $file, $menuName, $uploadToken] = $request->postMore([ + ['pid', 0], + ['file', 'file'], + ['menu_name', ''], + ['uploadToken', ''] + ], true); + $service = app()->make(SystemAttachmentServices::class); + if ($service->cacheDriver()->get('scan_upload') != $uploadToken) { + return app('json')->fail(410086); + } + $service->upload((int)$pid, $file, $upload_type, $type, $menuName); + return app('json')->success(100032); + } } diff --git a/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php b/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php index 93742d5e1..ff95bf1b2 100644 --- a/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php +++ b/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php @@ -135,4 +135,19 @@ class SystemAttachment extends AuthController $res = $this->service->videoUpload($data, $_FILES['file']); return app('json')->success($res); } + + /** + * 获取扫码上传页面链接以及参数 + * @return \think\Response + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/06/13 + */ + public function scanUploadQrcode() + { + $uploadToken = md5(time()); + $this->service->cacheDriver()->set('scan_upload', $uploadToken, 600); + $url = sys_config('site_url') . '/app/upload?token=' . $uploadToken; + return app('json')->success(['url' => $url]); + } } diff --git a/crmeb/app/adminapi/route/file.php b/crmeb/app/adminapi/route/file.php index 78d4a4dff..71779227b 100644 --- a/crmeb/app/adminapi/route/file.php +++ b/crmeb/app/adminapi/route/file.php @@ -42,6 +42,9 @@ Route::group('file', function () { Route::get('upload_type', 'v1.file.SystemAttachment/uploadType')->option(['real_name' => '上传类型']); //分片上传本地视频 Route::post('video_upload', 'v1.file.SystemAttachment/videoUpload')->option(['real_name' => '分片上传本地视频']); + + //获取扫码上传页面链接以及参数 + Route::get('scan_upload/qrcode', 'v1.file.SystemAttachment/scanUploadQrcode')->option(['real_name' => '扫码上传页面链接']); })->middleware([ \app\http\middleware\AllowOriginMiddleware::class, \app\adminapi\middleware\AdminAuthTokenMiddleware::class, diff --git a/crmeb/app/adminapi/route/route.php b/crmeb/app/adminapi/route/route.php index bcb82d491..809f8b052 100644 --- a/crmeb/app/adminapi/route/route.php +++ b/crmeb/app/adminapi/route/route.php @@ -36,6 +36,10 @@ Route::group(function () { Route::get('get_workerman_url', 'PublicController/getWorkerManUrl')->option(['real_name' => '获取客服数据']); //测试 Route::get('index', 'Test/index')->option(['real_name' => '测试地址']); + + //扫码上传图片 + Route::post('image/scan_upload', 'PublicController/scanUpload')->name('ajcheck')->option(['real_name' => '一次验证']); + })->middleware(AllowOriginMiddleware::class)->option(['mark' => 'login', 'mark_name' => '登录相关']); /** From 34b7ad1b926d16d3a9d1462fc86cb3d5cb1b5ecd Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 13 Jun 2023 17:27:02 +0800 Subject: [PATCH 06/19] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=9A=84=E5=9B=BE=E7=89=87=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=20=E8=8E=B7=E5=8F=96=E6=89=AB=E7=A0=81=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E9=93=BE=E6=8E=A5=E4=BB=A5=E5=8F=8A=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/adminapi/controller/PublicController.php | 2 +- .../controller/v1/file/SystemAttachment.php | 13 +++++++++++++ crmeb/app/adminapi/route/file.php | 2 ++ .../system/attachment/SystemAttachmentDao.php | 16 ++++++++++++++++ .../attachment/SystemAttachmentServices.php | 4 +++- crmeb/public/install/crmeb.sql | 1 + 6 files changed, 36 insertions(+), 2 deletions(-) diff --git a/crmeb/app/adminapi/controller/PublicController.php b/crmeb/app/adminapi/controller/PublicController.php index 854fec012..bfeacc487 100644 --- a/crmeb/app/adminapi/controller/PublicController.php +++ b/crmeb/app/adminapi/controller/PublicController.php @@ -69,7 +69,7 @@ class PublicController if ($service->cacheDriver()->get('scan_upload') != $uploadToken) { return app('json')->fail(410086); } - $service->upload((int)$pid, $file, $upload_type, $type, $menuName); + $service->upload((int)$pid, $file, $upload_type, $type, $menuName, $uploadToken); return app('json')->success(100032); } } diff --git a/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php b/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php index ff95bf1b2..7ff5ef86b 100644 --- a/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php +++ b/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php @@ -150,4 +150,17 @@ class SystemAttachment extends AuthController $url = sys_config('site_url') . '/app/upload?token=' . $uploadToken; return app('json')->success(['url' => $url]); } + + /** + * 获取扫码上传的图片数据 + * @param $scan_token + * @return \think\Response + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/06/13 + */ + public function scanUploadImage($scan_token) + { + return app('json')->success($this->service->scanUploadImage($scan_token)); + } } diff --git a/crmeb/app/adminapi/route/file.php b/crmeb/app/adminapi/route/file.php index 71779227b..f68a1b120 100644 --- a/crmeb/app/adminapi/route/file.php +++ b/crmeb/app/adminapi/route/file.php @@ -45,6 +45,8 @@ Route::group('file', function () { //获取扫码上传页面链接以及参数 Route::get('scan_upload/qrcode', 'v1.file.SystemAttachment/scanUploadQrcode')->option(['real_name' => '扫码上传页面链接']); + //获取扫码上传的图片数据 + Route::get('scan_upload/image/:scan_token', 'v1.file.SystemAttachment/scanUploadImage')->option(['real_name' => '获取扫码上传的图片数据']); })->middleware([ \app\http\middleware\AllowOriginMiddleware::class, \app\adminapi\middleware\AdminAuthTokenMiddleware::class, diff --git a/crmeb/app/dao/system/attachment/SystemAttachmentDao.php b/crmeb/app/dao/system/attachment/SystemAttachmentDao.php index b648d0bba..cfed3adfc 100644 --- a/crmeb/app/dao/system/attachment/SystemAttachmentDao.php +++ b/crmeb/app/dao/system/attachment/SystemAttachmentDao.php @@ -92,4 +92,20 @@ class SystemAttachmentDao extends BaseDao { $this->getModel()->whereTime('time', 'yesterday')->where('module_type', 2)->delete(); } + + /** + * 获取扫码上传的图片数据 + * @param $scan_token + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/06/13 + */ + public function scanUploadImage($scan_token) + { + return $this->getModel()->where('scan_token', $scan_token)->select()->toArray(); + } } diff --git a/crmeb/app/services/system/attachment/SystemAttachmentServices.php b/crmeb/app/services/system/attachment/SystemAttachmentServices.php index 2b1cb6ef7..affeae8c2 100644 --- a/crmeb/app/services/system/attachment/SystemAttachmentServices.php +++ b/crmeb/app/services/system/attachment/SystemAttachmentServices.php @@ -25,6 +25,7 @@ use app\services\other\UploadService; * @package app\services\attachment * @method getYesterday() 获取昨日生成数据 * @method delYesterday() 删除昨日生成数据 + * @method scanUploadImage($scan_token) 获取扫码上传的图片数据 */ class SystemAttachmentServices extends BaseServices { @@ -109,7 +110,7 @@ class SystemAttachmentServices extends BaseServices * @param int $type * @return mixed */ - public function upload(int $pid, string $file, int $upload_type, int $type, $menuName) + public function upload(int $pid, string $file, int $upload_type, int $type, $menuName, $uploadToken = '') { $realName = false; if ($upload_type == 0) { @@ -139,6 +140,7 @@ class SystemAttachmentServices extends BaseServices $data['module_type'] = 1; $data['time'] = $fileInfo['time'] ?? time(); $data['pid'] = $pid; + $data['scan_token'] = $uploadToken; $this->dao->save($data); } return $res->filePath; diff --git a/crmeb/public/install/crmeb.sql b/crmeb/public/install/crmeb.sql index 9428e5060..13fb23d75 100755 --- a/crmeb/public/install/crmeb.sql +++ b/crmeb/public/install/crmeb.sql @@ -29451,6 +29451,7 @@ CREATE TABLE IF NOT EXISTS `eb_system_attachment` ( `image_type` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '图片上传类型 1本地 2七牛云 3OSS 4COS ', `module_type` tinyint(1) UNSIGNED NOT NULL DEFAULT '1' COMMENT '图片上传模块类型 1 后台上传 2 用户生成', `real_name` varchar(255) NOT NULL DEFAULT '' COMMENT '原始文件名', + `scan_token` varchar(32) NOT NULL DEFAULT '' COMMENT '扫码上传的token', PRIMARY KEY (`att_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=92 DEFAULT CHARSET=utf8 COMMENT='附件管理表'; From 7b732dabdbb2a3ff168715f8caa37ad692939860 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Tue, 13 Jun 2023 17:44:53 +0800 Subject: [PATCH 07/19] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BA=91=E5=AD=98?= =?UTF-8?q?=E5=82=A8=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/v1/product/StoreProduct.php | 3 +-- crmeb/crmeb/services/upload/extend/obs/Client.php | 1 + crmeb/crmeb/services/upload/storage/Jdoss.php | 5 ++++- crmeb/crmeb/services/upload/storage/Obs.php | 14 +++++++++++--- crmeb/crmeb/services/upload/storage/Tyoss.php | 15 ++++++++++++--- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/product/StoreProduct.php b/crmeb/app/adminapi/controller/v1/product/StoreProduct.php index aae882592..aaa020ed7 100644 --- a/crmeb/app/adminapi/controller/v1/product/StoreProduct.php +++ b/crmeb/app/adminapi/controller/v1/product/StoreProduct.php @@ -351,8 +351,7 @@ class StoreProduct extends AuthController if (!$key || !$contentType) { return app('json')->fail('缺少参数'); } - $url = $upload->getTempKeys($key, $path, $contentType); - $re = ['url' => $url]; + $re = $upload->getTempKeys($key, $path, $contentType); } else { $re = $upload->getTempKeys(); } diff --git a/crmeb/crmeb/services/upload/extend/obs/Client.php b/crmeb/crmeb/services/upload/extend/obs/Client.php index b2ad87782..40e7aa362 100644 --- a/crmeb/crmeb/services/upload/extend/obs/Client.php +++ b/crmeb/crmeb/services/upload/extend/obs/Client.php @@ -431,6 +431,7 @@ class Client extends BaseClient } } + /** * 地域名称 * @return \string[][] diff --git a/crmeb/crmeb/services/upload/storage/Jdoss.php b/crmeb/crmeb/services/upload/storage/Jdoss.php index d712513fa..4435ded6d 100644 --- a/crmeb/crmeb/services/upload/storage/Jdoss.php +++ b/crmeb/crmeb/services/upload/storage/Jdoss.php @@ -358,7 +358,10 @@ class Jdoss extends BaseUpload ] ); $request = $app->createPresignedRequest($cmd, $expires); - return (string)$request->getUri(); + return [ + 'url' => (string)$request->getUri(), + 'type' => 'JDOSS' + ]; } catch (\Throwable $e) { return $this->setError($e->getMessage()); } diff --git a/crmeb/crmeb/services/upload/storage/Obs.php b/crmeb/crmeb/services/upload/storage/Obs.php index 20b03af90..8498d1a40 100644 --- a/crmeb/crmeb/services/upload/storage/Obs.php +++ b/crmeb/crmeb/services/upload/storage/Obs.php @@ -202,7 +202,7 @@ class Obs extends BaseUpload public function getDomian($name, $region) { try { - $res = $this->app()->GetBucketDomain($name, $region); + $res = $this->app()->getBucketDomain($name, $region); if ($res) { $domainRules = $res->toArray()['ListBucketCustomDomainsResult']; return array_column($domainRules, 'DomainName'); @@ -231,7 +231,7 @@ class Obs extends BaseUpload public function setBucketCors(string $name, string $region) { try { - $this->app()->PutBucketCors($name, $region, [ + $this->app()->putBucketCors($name, $region, [ 'AllowedHeader' => ['*'], 'AllowedMethod' => ['PUT', 'GET', 'POST', 'DELETE', 'HEAD'], 'AllowedOrigin' => ['*'], @@ -244,9 +244,17 @@ class Obs extends BaseUpload } } + /** + * @return array + * @date 2023/6/13 + */ public function getTempKeys() { - // TODO: Implement getTempKeys() method. + return [ + 'access_key' => $this->accessKey, + 'secret_key' => $this->secretKey, + 'type' => 'OBS' + ]; } /** diff --git a/crmeb/crmeb/services/upload/storage/Tyoss.php b/crmeb/crmeb/services/upload/storage/Tyoss.php index 2233ba07f..7df3be61d 100644 --- a/crmeb/crmeb/services/upload/storage/Tyoss.php +++ b/crmeb/crmeb/services/upload/storage/Tyoss.php @@ -331,7 +331,7 @@ class Tyoss extends BaseUpload public function getDomian($name, $region) { try { - $res = $this->app()->GetBucketDomain($name, $region); + $res = $this->app()->getBucketDomain($name, $region); if ($res) { $domainRules = $res->toArray()['ListBucketCustomDomainsResult']; return array_column($domainRules, 'DomainName'); @@ -360,7 +360,7 @@ class Tyoss extends BaseUpload public function setBucketCors(string $name, string $region) { try { - $this->app()->PutBucketCors($name, $region, [ + $this->app()->putBucketCors($name, $region, [ 'AllowedHeader' => ['*'], 'AllowedMethod' => ['PUT', 'GET', 'POST', 'DELETE', 'HEAD'], 'AllowedOrigin' => ['*'], @@ -372,9 +372,18 @@ class Tyoss extends BaseUpload return $this->setError($e->getMessage()); } } + + /** + * @return array + * @date 2023/6/13 + */ public function getTempKeys() { - // TODO: Implement getTempKeys() method. + return [ + 'access_key' => $this->accessKey, + 'secret_key' => $this->secretKey, + 'type' => 'TYOSS' + ]; } /** From c73fa859b8dc84c17b5d4ca8999cb16d139722da Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 13 Jun 2023 17:45:45 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E6=89=AB=E7=A0=81=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/PublicController.php | 6 ++---- crmeb/app/adminapi/route/route.php | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crmeb/app/adminapi/controller/PublicController.php b/crmeb/app/adminapi/controller/PublicController.php index bfeacc487..0fd00d819 100644 --- a/crmeb/app/adminapi/controller/PublicController.php +++ b/crmeb/app/adminapi/controller/PublicController.php @@ -59,17 +59,15 @@ class PublicController */ public function scanUpload(Request $request, $upload_type = 0, $type = 0) { - [$pid, $file, $menuName, $uploadToken] = $request->postMore([ - ['pid', 0], + [$file, $uploadToken] = $request->postMore([ ['file', 'file'], - ['menu_name', ''], ['uploadToken', ''] ], true); $service = app()->make(SystemAttachmentServices::class); if ($service->cacheDriver()->get('scan_upload') != $uploadToken) { return app('json')->fail(410086); } - $service->upload((int)$pid, $file, $upload_type, $type, $menuName, $uploadToken); + $service->upload(0, $file, $upload_type, $type, '', $uploadToken); return app('json')->success(100032); } } diff --git a/crmeb/app/adminapi/route/route.php b/crmeb/app/adminapi/route/route.php index 809f8b052..ef103bace 100644 --- a/crmeb/app/adminapi/route/route.php +++ b/crmeb/app/adminapi/route/route.php @@ -38,7 +38,7 @@ Route::group(function () { Route::get('index', 'Test/index')->option(['real_name' => '测试地址']); //扫码上传图片 - Route::post('image/scan_upload', 'PublicController/scanUpload')->name('ajcheck')->option(['real_name' => '一次验证']); + Route::post('image/scan_upload', 'PublicController/scanUpload')->option(['real_name' => '扫码上传图片']); })->middleware(AllowOriginMiddleware::class)->option(['mark' => 'login', 'mark_name' => '登录相关']); From c48dc8ec7e36d3a1b75f9a997b8e694f1540bd00 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 13 Jun 2023 18:22:04 +0800 Subject: [PATCH 09/19] =?UTF-8?q?=E7=BD=91=E7=BB=9C=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/v1/file/SystemAttachment.php | 17 +++++++ crmeb/app/adminapi/route/file.php | 2 + .../system/attachment/SystemAttachmentDao.php | 2 +- .../attachment/SystemAttachmentServices.php | 51 +++++++++++++++++++ 4 files changed, 71 insertions(+), 1 deletion(-) diff --git a/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php b/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php index 7ff5ef86b..8dd44ce3a 100644 --- a/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php +++ b/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php @@ -163,4 +163,21 @@ class SystemAttachment extends AuthController { return app('json')->success($this->service->scanUploadImage($scan_token)); } + + /** + * 网络图片上传 + * @return \think\Response + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/06/13 + */ + public function onlineUpload() + { + $data = $this->request->postMore([ + ['pid', 0], + ['images', []] + ]); + $this->service->onlineUpload($data); + return app('json')->success(100032); + } } diff --git a/crmeb/app/adminapi/route/file.php b/crmeb/app/adminapi/route/file.php index f68a1b120..c6ad032d9 100644 --- a/crmeb/app/adminapi/route/file.php +++ b/crmeb/app/adminapi/route/file.php @@ -47,6 +47,8 @@ Route::group('file', function () { Route::get('scan_upload/qrcode', 'v1.file.SystemAttachment/scanUploadQrcode')->option(['real_name' => '扫码上传页面链接']); //获取扫码上传的图片数据 Route::get('scan_upload/image/:scan_token', 'v1.file.SystemAttachment/scanUploadImage')->option(['real_name' => '获取扫码上传的图片数据']); + //网络图片上传 + Route::post('online_upload', 'v1.file.SystemAttachment/onlineUpload')->option(['real_name' => '网络图片上传']); })->middleware([ \app\http\middleware\AllowOriginMiddleware::class, \app\adminapi\middleware\AdminAuthTokenMiddleware::class, diff --git a/crmeb/app/dao/system/attachment/SystemAttachmentDao.php b/crmeb/app/dao/system/attachment/SystemAttachmentDao.php index cfed3adfc..561fec633 100644 --- a/crmeb/app/dao/system/attachment/SystemAttachmentDao.php +++ b/crmeb/app/dao/system/attachment/SystemAttachmentDao.php @@ -106,6 +106,6 @@ class SystemAttachmentDao extends BaseDao */ public function scanUploadImage($scan_token) { - return $this->getModel()->where('scan_token', $scan_token)->select()->toArray(); + return $this->getModel()->where('scan_token', $scan_token)->field('att_dir,att_id')->select()->toArray(); } } diff --git a/crmeb/app/services/system/attachment/SystemAttachmentServices.php b/crmeb/app/services/system/attachment/SystemAttachmentServices.php index affeae8c2..7ee49f2ec 100644 --- a/crmeb/app/services/system/attachment/SystemAttachmentServices.php +++ b/crmeb/app/services/system/attachment/SystemAttachmentServices.php @@ -14,6 +14,7 @@ namespace app\services\system\attachment; use app\services\BaseServices; use app\dao\system\attachment\SystemAttachmentDao; +use app\services\product\product\CopyTaobaoServices; use crmeb\exceptions\AdminException; use crmeb\exceptions\ApiException; use crmeb\exceptions\UploadException; @@ -284,4 +285,54 @@ class SystemAttachmentServices extends BaseServices } return $res; } + + /** + * 网络图片上传 + * @param $data + * @return bool + * @throws \Exception + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/06/13 + */ + public function onlineUpload($data) + { + //生成附件目录 + if (make_path('attach', 3, true) === '') { + throw new AdminException(400555); + } + + //上传图片 + /** @var SystemAttachmentServices $systemAttachmentService */ + $systemAttachmentService = app()->make(SystemAttachmentServices::class); + $siteUrl = sys_config('site_url'); + + foreach ($data['images'] as $image) { + $uploadValue = app()->make(CopyTaobaoServices::class)->downloadImage($image); + if (is_array($uploadValue)) { + //TODO 拼接图片地址 + if ($uploadValue['image_type'] == 1) { + $imagePath = $siteUrl . $uploadValue['path']; + } else { + $imagePath = $uploadValue['path']; + } + //写入数据库 + if (!$uploadValue['is_exists']) { + $systemAttachmentService->save([ + 'name' => $uploadValue['name'], + 'real_name' => $uploadValue['name'], + 'att_dir' => $imagePath, + 'satt_dir' => $imagePath, + 'att_size' => $uploadValue['size'], + 'att_type' => $uploadValue['mime'], + 'image_type' => $uploadValue['image_type'], + 'module_type' => 1, + 'time' => time(), + 'pid' => $data['pid'] + ]); + } + } + } + return true; + } } From 7c6d0c0af483e79dbc6f3649e11d9495644e0f9c Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Tue, 13 Jun 2023 18:37:42 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/file/SystemAttachment.php | 1 + 1 file changed, 1 insertion(+) diff --git a/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php b/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php index 8dd44ce3a..5fecf7421 100644 --- a/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php +++ b/crmeb/app/adminapi/controller/v1/file/SystemAttachment.php @@ -167,6 +167,7 @@ class SystemAttachment extends AuthController /** * 网络图片上传 * @return \think\Response + * @throws \Exception * @author 吴汐 * @email 442384644@qq.com * @date 2023/06/13 From 6c27d692074eea663bc041b13bdafca243593d63 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 14 Jun 2023 10:20:54 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E5=AE=B6?= =?UTF-8?q?=E5=AF=84=E4=BB=B6=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/order/StoreOrder.php | 5 ++++- crmeb/app/services/order/StoreOrderDeliveryServices.php | 6 ++++++ crmeb/crmeb/services/express/storage/Express.php | 7 ++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php index d0ed1fbe8..da92fb0a2 100644 --- a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php +++ b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php @@ -286,7 +286,10 @@ class StoreOrder extends AuthController ['fictitious_content', ''],//虚拟发货内容 - ['cart_ids', []] + ['cart_ids', []], + + ['day_type', 0], //顺丰传 0今天,1明天,2后台 + ['pickup_time', []],//开始时间 9:00,结束时间 10:00 开始时间和结束时间之间不能小于一个小时 ]); if (!$id) { return app('json')->fail(100100); diff --git a/crmeb/app/services/order/StoreOrderDeliveryServices.php b/crmeb/app/services/order/StoreOrderDeliveryServices.php index 1b723f21c..17f074977 100644 --- a/crmeb/app/services/order/StoreOrderDeliveryServices.php +++ b/crmeb/app/services/order/StoreOrderDeliveryServices.php @@ -440,6 +440,12 @@ class StoreOrderDeliveryServices extends BaseServices /** @var StoreOrderCartInfoServices $orderInfoServices */ $orderInfoServices = app()->make(StoreOrderCartInfoServices::class); $storeName = $orderInfoServices->getCarIdByProductTitle((int)$orderInfo->id); + + if (count($data['pickup_time']) == 2) { + $data['pickup_start_time'] = $data['pickup_time'][0]; + $data['pickup_end_time'] = $data['pickup_time'][1]; + } + // 发货信息录入 $res = []; switch ($type) { diff --git a/crmeb/crmeb/services/express/storage/Express.php b/crmeb/crmeb/services/express/storage/Express.php index cd4dc4800..518727179 100644 --- a/crmeb/crmeb/services/express/storage/Express.php +++ b/crmeb/crmeb/services/express/storage/Express.php @@ -74,7 +74,12 @@ class Express extends BaseExpress */ public function getKuaidiComs() { - return $this->accessToken->httpRequest(self::SHIPMENT_KUAIDI_NUMS, [], 'GET'); + $list = $this->accessToken->httpRequest(self::SHIPMENT_KUAIDI_NUMS, [], 'GET'); + foreach ($list as &$item) { + $item['code'] = $item['value']; + $item['value'] = $item['label']; + } + return $list; } /** From ffd8f4bb66b8c2bdb208cadc295945bb0ab14653 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 14 Jun 2023 10:21:08 +0800 Subject: [PATCH 12/19] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=89=E8=A3=85sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/public/install/crmeb.sql | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/crmeb/public/install/crmeb.sql b/crmeb/public/install/crmeb.sql index 13fb23d75..aafb84d66 100755 --- a/crmeb/public/install/crmeb.sql +++ b/crmeb/public/install/crmeb.sql @@ -33606,8 +33606,8 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (116, 'order_seckill_time', 'text', 'number', 27, '', 0, '', 100, 0, '1', '秒杀未支付订单取消时间', '秒杀未支付订单取消时间,单位(小时),如果为0将使用默认活动取消时间,优先使用单独活动配置', 0, 1), (117, 'order_pink_time', 'text', 'number', 27, '', 0, '', 100, 0, '1', '拼团未支付取消订单时间', '拼团未支付取消订单时间,单位(小时),如果为0将使用默认活动取消时间,优先使用单独活动配置', 0, 1), (122, 'system_delivery_time', 'text', 'number', 27, '', 0, 'required:true,digits:true,min:0', 100, 0, '7', '自动收货时间', '系统自动收货时间,单位(天),0为不设置自动收货', 80, 1), -(123, 'sms_account', 'text', 'input', 18, '', 0, '', 100, 0, '\"\"', '一号通账号', '短信后台的登录账号', 0, 1), -(137, 'sms_token', 'text', 'input', 18, '', 0, '', 100, 0, '\"\"', '一号通密码', '短信后台的登录密码)', 0, 1), +(123, 'sms_account', 'text', 'input', 18, '', 1, '', 0, 0, '\"\"', '一号通AccessKey', '一号通账号内创建的AccessKey', 10, 1), +(137, 'sms_token', 'text', 'input', 18, '', 1, '', 0, 0, '\"\"', '一号通SecretKey', '一号通账号内创建的SecretKey', 9, 1), (138, 'h5_avatar', 'upload', 'input', 101, '', 1, '', 0, 0, '\"\\/statics\\/system_images\\/default_avatar.jpeg\"', '用户默认头像', '用户默认头像,后台添加用户以及用户登录的默认头像显示,尺寸(80*80)', 3, 1), (139, 'offline_pay_status', 'radio', 'input', 109, '1=>开启\n2=>关闭', 1, '', 0, 0, '\"1\"', '线下支付', '线下支付请选择开启或关闭', 89, 1), (141, 'recharge_switch', 'radio', 'input', 28, '1=>开启\n0=>关闭', 1, '', 0, 0, '0', '小程序充值开关', '仅小程序端的充值开关,小程序提交审核前,需要关闭此功能', 4, 1), @@ -33765,7 +33765,19 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (435, 'icp_url', 'text', 'input', 26, '', 1, '', 0, 0, '\"https:\\/\\/beian.miit.gov.cn\"', 'ICP备案链接', 'H5和PC底部显示的ICP备案号点击跳转的链接', 9, 1), (436, 'network_security_url', 'text', 'input', 26, '', 1, '', 0, 0, '\"https:\\/\\/www.beian.gov.cn\"', '网安备案链接', 'H5和PC底部显示的网安备案号点击跳转的链接', 7, 1), (437, 'agent_apply_open', 'radio', 'input', 72, '1=>开启\n0=>关闭', 1, '', 0, 0, '1', '代理商申请开关', '控制移动端我的推广页面的代理商申请按钮是否显示', 0, 1), -(438, 'order_shipping_open', 'radio', 'input', 7, '1=>开启\n0=>关闭', 1, '', 0, 0, '0', '小程序发货信息管理服务', '小程序有订单发货管理时,请打开此开关,否则会导致订单资金冻结', 0, 1); +(438, 'order_shipping_open', 'radio', 'input', 7, '1=>开启\n0=>关闭', 1, '', 0, 0, '0', '小程序发货信息管理服务', '小程序有订单发货管理时,请打开此开关,否则会导致订单资金冻结', 0, 1), +(440, 'jd_accessKey', 'text', 'input', 110, '', 1, '', 100, 0, '\"\"', '京东云accessKey', '京东云accessKey', 0, 1), +(441, 'jd_secretKey', 'text', 'input', 110, '', 1, '', 100, 0, '\"\"', '京东云secretKey', '京东云secretKey', 0, 1), +(442, 'hw_accessKey', 'text', 'input', 111, '', 1, '', 100, 0, '\"\"', '华为云accessKey', '华为云accessKey', 0, 1), +(443, 'hw_secretKey', 'text', 'input', 111, '', 1, '', 100, 0, '\"\"', '华为云secretKey', '华为云secretKey', 0, 1), +(444, 'ty_secretKey', 'text', 'input', 112, '', 1, '', 100, 0, '\"\"', '天翼云secretKey', '天翼云secretKey', 0, 1), +(445, 'ty_accessKey', 'text', 'input', 112, '', 1, '', 100, 0, '\"\"', '天翼云accessKey', '天翼云accessKey', 0, 1), +(446, 'coupon_return_open', 'radio', 'input', 27, '1=>退还\n0=>不退还', 1, '', 0, 0, '\"1\"', '优惠券退还状态', '优惠券是否退回开关,商品成功退款后,退回/不退回使用的优惠券', 0, 1), +(447, 'yihaotong_sms_appid', 'text', 'input', 18, '', 1, '', 0, 0, '\"\"', '短信服务AppId', '一号通应用管理内短信服务的appid,不填写则使用默认的应用appid', 0, 1), +(448, 'yihaotong_send_appid', 'text', 'input', 18, '', 1, '', 0, 0, '\"\"', '商家寄件AppId', '一号通应用管理内商家寄件的appid,不填写则使用默认的应用appid', 0, 1), +(449, 'yihaotong_face_appid', 'text', 'input', 18, '', 1, '', 100, 0, '\"\"', '面单打印AppId', '一号通应用管理内面单打印的appid,不填写则使用默认的应用appid', 0, 1), +(450, 'yihaotong_express_appid', 'text', 'input', 18, '', 1, '', 100, 0, '\"\"', '物流查询AppId', '一号通应用管理内物流查询的appid,不填写则使用默认的应用appid', 0, 1), +(451, 'yihaotong_copy_appid', 'text', '', 18, '', 1, '', 100, 0, '\"\"', '商品采集AppId', '一号通应用管理内商品采集的appid,不填写则使用默认的应用appid', 0, 1); -- -------------------------------------------------------- @@ -33847,7 +33859,10 @@ INSERT INTO `eb_system_config_tab` (`id`, `pid`, `title`, `eng_title`, `status`, (106, 5, '机器翻译配置', 'online_translation', 1, 0, '', 0, 0), (107, 21, '飞鹅云配置', 'fey_config', 1, 0, '', 3, 0), (108, 23, '通联支付', 'allinpay', 1, 0, '', 3, 0), -(109, 23, '基础配置', 'pay_basic', 1, 0, '', 3, 100); +(109, 23, '基础配置', 'pay_basic', 1, 0, '', 3, 100), +(110, 79, '京东云配置', 'jd_oss_config', 0, 0, '', 0, 0), +(111, 79, '华为云配置', 'obs_config', 0, 0, '', 0, 0), +(112, 79, '天翼云配置', 'ty_oss_config', 0, 0, '', 0, 0); -- -------------------------------------------------------- From afed94b88af9a510e4b5161d34f75ffcfb49d91e Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 14 Jun 2023 10:26:10 +0800 Subject: [PATCH 13/19] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A8=A1=E7=89=88?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/services/express/storage/Express.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crmeb/crmeb/services/express/storage/Express.php b/crmeb/crmeb/services/express/storage/Express.php index 518727179..bbfe0a8d6 100644 --- a/crmeb/crmeb/services/express/storage/Express.php +++ b/crmeb/crmeb/services/express/storage/Express.php @@ -78,6 +78,11 @@ class Express extends BaseExpress foreach ($list as &$item) { $item['code'] = $item['value']; $item['value'] = $item['label']; + $num = 1; + foreach ($item['list'] as &$value) { + $value['title'] = $item['label'] . '模版' . $num; + $num++; + } } return $list; } From ddd8569eec1e447c8121ef38942e760fb4abcd39 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 14 Jun 2023 10:35:10 +0800 Subject: [PATCH 14/19] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=9D=9E=E6=8B=86?= =?UTF-8?q?=E5=8D=95=E5=8F=91=E8=B4=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/adminapi/controller/v1/order/StoreOrder.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php index da92fb0a2..3a0dbd51a 100644 --- a/crmeb/app/adminapi/controller/v1/order/StoreOrder.php +++ b/crmeb/app/adminapi/controller/v1/order/StoreOrder.php @@ -252,7 +252,10 @@ class StoreOrder extends AuthController ['sh_delivery_id', ''],//送货人电话 ['sh_delivery_uid', ''],//送货人ID - ['fictitious_content', '']//虚拟发货内容 + ['fictitious_content', ''],//虚拟发货内容 + + ['day_type', 0], //顺丰传 0今天,1明天,2后台 + ['pickup_time', []],//开始时间 9:00,结束时间 10:00 开始时间和结束时间之间不能小于一个小时 ]); return app('json')->success(100010, $services->delivery((int)$id, $data)); } From bd35e9692bfafd69ec8f9478b69137f08e65da03 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 14 Jun 2023 10:48:27 +0800 Subject: [PATCH 15/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/order/StoreOrderDeliveryServices.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crmeb/app/services/order/StoreOrderDeliveryServices.php b/crmeb/app/services/order/StoreOrderDeliveryServices.php index 17f074977..0cae5a338 100644 --- a/crmeb/app/services/order/StoreOrderDeliveryServices.php +++ b/crmeb/app/services/order/StoreOrderDeliveryServices.php @@ -570,9 +570,9 @@ class StoreOrderDeliveryServices extends BaseServices $expData['day_type'] = $data['day_type']; $expData['pickup_start_time'] = $data['pickup_start_time']; $expData['pickup_end_time'] = $data['pickup_end_time']; - if (!sys_config('config_shippment_open', 0)) { - throw new AdminException('商家寄件未开启无法寄件'); - } +// if (!sys_config('config_shippment_open', 0)) { +// throw new AdminException('商家寄件未开启无法寄件'); +// } $dump = $expressService->express()->shippmentCreateOrder($expData, sys_config('yihaotong_send_appid', '')); $orderInfo->delivery_id = $dump['kuaidinum'] ?? ''; $data['express_dump'] = json_encode([ From fae98145fad4a771aa6f88c85a1f05a858177f16 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 14 Jun 2023 10:52:08 +0800 Subject: [PATCH 16/19] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/crmeb/services/express/storage/Express.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crmeb/crmeb/services/express/storage/Express.php b/crmeb/crmeb/services/express/storage/Express.php index bbfe0a8d6..acb27d303 100644 --- a/crmeb/crmeb/services/express/storage/Express.php +++ b/crmeb/crmeb/services/express/storage/Express.php @@ -49,7 +49,7 @@ class Express extends BaseExpress //获取物流公司信息 const SHIPMENT_KUAIDI_NUMS = 'v2/shipment/get_kuaidi_coms'; //创建商家寄件订单 - const SHIPMENT_CREATE_ORDER = 'v2/v2/shipment/create_order'; + const SHIPMENT_CREATE_ORDER = 'v2/shipment/create_order'; //取消商家寄件 const SHIPMENT_CANCEL_ORDER = 'v2/shipment/cancel_order'; //获取商家寄件订单列表 @@ -109,7 +109,7 @@ class Express extends BaseExpress 'call_back_url' => sys_config('site_url') . '/api/order_call_back', 'return_type' => $siid ? '10' : '20', 'siid' => $siid, - 'tempid' => $data['tempid'], + 'tempid' => $data['temp_id'], 'cargo' => $data['cargo'], 'weight' => $data['weight'], 'day_type' => $data['day_type'], From 5633c128cabb0ab90ae635e6ef5af139b03ac8a0 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 14 Jun 2023 11:00:14 +0800 Subject: [PATCH 17/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=AE=B6?= =?UTF-8?q?=E5=AF=84=E4=BB=B6=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/order/StoreOrderDeliveryServices.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crmeb/app/services/order/StoreOrderDeliveryServices.php b/crmeb/app/services/order/StoreOrderDeliveryServices.php index 0cae5a338..2fa069d1e 100644 --- a/crmeb/app/services/order/StoreOrderDeliveryServices.php +++ b/crmeb/app/services/order/StoreOrderDeliveryServices.php @@ -576,7 +576,7 @@ class StoreOrderDeliveryServices extends BaseServices $dump = $expressService->express()->shippmentCreateOrder($expData, sys_config('yihaotong_send_appid', '')); $orderInfo->delivery_id = $dump['kuaidinum'] ?? ''; $data['express_dump'] = json_encode([ - 'com' => $expData['com'], + 'com' => $expData['kuaidicom'], 'from_name' => $expData['from_name'], 'from_tel' => $expData['from_tel'], 'from_addr' => $expData['from_addr'], From cfbd337ecced8f8b763b2297c00ae4291d5bed9e Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Wed, 14 Jun 2023 11:01:13 +0800 Subject: [PATCH 18/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=95=86=E5=AE=B6?= =?UTF-8?q?=E5=AF=84=E4=BB=B6=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/order/StoreOrderDeliveryServices.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crmeb/app/services/order/StoreOrderDeliveryServices.php b/crmeb/app/services/order/StoreOrderDeliveryServices.php index 2fa069d1e..777fed1eb 100644 --- a/crmeb/app/services/order/StoreOrderDeliveryServices.php +++ b/crmeb/app/services/order/StoreOrderDeliveryServices.php @@ -577,9 +577,9 @@ class StoreOrderDeliveryServices extends BaseServices $orderInfo->delivery_id = $dump['kuaidinum'] ?? ''; $data['express_dump'] = json_encode([ 'com' => $expData['kuaidicom'], - 'from_name' => $expData['from_name'], - 'from_tel' => $expData['from_tel'], - 'from_addr' => $expData['from_addr'], + 'from_name' => $expData['send_real_name'], + 'from_tel' => $expData['send_phone'], + 'from_addr' => $expData['send_address'], 'temp_id' => $expData['temp_id'], 'cargo' => $expData['cargo'], ]); From accea1d3df543d059928c92d1a94676e11a81792 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Thu, 15 Jun 2023 14:50:14 +0800 Subject: [PATCH 19/19] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=B2=E7=BB=8F?= =?UTF-8?q?=E6=8B=86=E5=8D=95=E7=9A=84=E4=B8=BB=E8=AE=A2=E5=8D=95=E8=BF=98?= =?UTF-8?q?=E8=83=BD=E7=BB=A7=E7=BB=AD=E6=8B=86=E5=8D=95=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/api/controller/v1/order/StoreOrderController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 5b2ba4b07..dfb54fa1f 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -716,6 +716,7 @@ class StoreOrderController if (!$order || $uid != $order['uid']) { return app('json')->fail(410173); } + if ($order['pid'] == -1) return app('json')->fail('主订单已拆单,请刷新页面'); $refundData = [ 'refund_reason' => $data['text'], 'refund_explain' => $data['refund_reason_wap_explain'],