diff --git a/crmeb/app/adminapi/controller/Common.php b/crmeb/app/adminapi/controller/Common.php index 6c04e3142..92df9cd54 100644 --- a/crmeb/app/adminapi/controller/Common.php +++ b/crmeb/app/adminapi/controller/Common.php @@ -60,7 +60,7 @@ class Common extends AuthController $res = $res ? json_decode($res, true) : []; //兼容test. - if ($res['data']['status'] !== 1) { + if (!isset($res['data']['status']) || $res['data']['status'] !== 1) { $host = str_replace('test.', '', $host); $res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [ 'domain_name' => $host, @@ -71,7 +71,7 @@ class Common extends AuthController } //如果是主域名兼容www. - if ($res['data']['status'] !== 1) { + if (!isset($res['data']['status']) || $res['data']['status'] !== 1) { $host = str_replace('www.', '', $host); $res = HttpService::request('http://authorize.crmeb.net/api/auth_cert_query', 'post', [ 'domain_name' => $host, @@ -82,9 +82,9 @@ class Common extends AuthController } //升级状态 - /** @var UpgradeServices $upgradeServices */ - $upgradeServices = app()->make(UpgradeServices::class); - $upgradeStatus = $upgradeServices->getUpgradeStatus(); +// /** @var UpgradeServices $upgradeServices */ +// $upgradeServices = app()->make(UpgradeServices::class); +// $upgradeStatus = $upgradeServices->getUpgradeStatus(); $status = $res['data']['status'] ?? -9; switch ((int)$status) { @@ -402,6 +402,7 @@ class Common extends AuthController 'info' => '' ]); } + \crmeb\services\CacheService::clear(); return app('json')->success(100000); } diff --git a/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php b/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php index 1f9dfa2d6..4b9d8571e 100644 --- a/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php +++ b/crmeb/app/adminapi/controller/v1/setting/SystemNotification.php @@ -91,10 +91,7 @@ class SystemNotification extends AuthController if ($data['mark'] == 'verify_code') $data['type'] = 'is_sms'; if (!$data['id']) return app('json')->fail(100100); if ($this->services->saveData($data)) { - CacheService::delete('NOTICE_SMS_' . $data['mark']); - CacheService::delete('wechat_' . $data['mark']); - CacheService::delete('routine_' . $data['mark']); - CacheService::delete('TEMP_IDS_LIST'); + CacheService::clear(); return app('json')->success(100001); } else { return app('json')->fail(100007); @@ -117,10 +114,7 @@ class SystemNotification extends AuthController if ($type == '' || $status == '' || $id == 0) return app('json')->fail(100100); $this->services->update($id, [$type => $status]); $res = $this->services->getOneNotce(['id' => $id]); - CacheService::delete('NOTICE_SMS_' . $res->mark); - CacheService::delete('wechat_' . $res->mark); - CacheService::delete('routine_' . $res->mark); - CacheService::delete('TEMP_IDS_LIST'); + CacheService::clear(); return app('json')->success(100014); } } diff --git a/crmeb/app/api/controller/pc/PublicController.php b/crmeb/app/api/controller/pc/PublicController.php index a7405a5eb..a27240474 100644 --- a/crmeb/app/api/controller/pc/PublicController.php +++ b/crmeb/app/api/controller/pc/PublicController.php @@ -50,6 +50,7 @@ class PublicController $data['site_name'] = sys_config('site_name'); $data['site_keywords'] = sys_config('site_keywords'); $data['site_description'] = sys_config('site_description'); + $data['network_security'] = sys_config('network_security'); $logoUrl = sys_config('pc_logo'); if (strstr($logoUrl, 'http') === false && $logoUrl) { $logoUrl = sys_config('site_url') . $logoUrl; diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index f632e69c5..7f5b7eb90 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -168,7 +168,7 @@ class StoreOrderController $userInfo = $request->user()->toArray(); if ($checkOrder = $this->services->getOne(['order_id|unique' => $key, 'uid' => $userInfo['uid'], 'is_del' => 0])) return app('json')->status('extend_order', 410209, ['orderId' => $checkOrder['order_id'], 'key' => $key]); - [$addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckillId, $bargainId, $shipping_type, $real_name, $phone, $storeId, $news, $invoice_id, $quitUrl, $advanceId, $virtual_type, $customForm] = $request->postMore([ + [$addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckillId, $bargainId, $shipping_type, $real_name, $phone, $storeId, $news, $invoice_id, $advanceId, $customForm] = $request->postMore([ [['addressId', 'd'], 0], [['couponId', 'd'], 0], ['payType', ''], @@ -184,9 +184,7 @@ class StoreOrderController [['store_id', 'd'], 0], ['new', 0], [['invoice_id', 'd'], 0], - ['quitUrl', ''], [['advanceId', 'd'], 0], - ['virtual_type', 0], ['custom_form', []], ], true); $payType = strtolower($payType); @@ -249,6 +247,7 @@ class StoreOrderController if (!$uni) return app('json')->fail(100100); $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->pay_uid = $uid; $orderInfo->save(); $orderInfo = $orderInfo->toArray(); @@ -262,7 +261,7 @@ class StoreOrderController } //重新生成订单号去支付 - $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; +// $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; //0元支付 if (bcsub((string)$orderInfo['pay_price'], '0', 2) <= 0) { diff --git a/crmeb/app/dao/BaseDao.php b/crmeb/app/dao/BaseDao.php index 338253d2c..7061af2b0 100644 --- a/crmeb/app/dao/BaseDao.php +++ b/crmeb/app/dao/BaseDao.php @@ -291,38 +291,43 @@ abstract class BaseDao } /** - * 获取搜索器和搜索条件key - * @param array $withSearch + * 获取搜索器和搜索条件key,以及不在搜索器的条件数组 + * @param array $where * @return array[] * @throws \ReflectionException + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/03/18 */ - private function getSearchData(array $withSearch) + private function getSearchData(array $where) { $with = []; - $whereKey = []; + $otherWhere = []; $responses = new \ReflectionClass($this->setModel()); - foreach ($withSearch as $fieldName) { - $method = 'search' . Str::studly($fieldName) . 'Attr'; + foreach ($where as $key => $value) { + $method = 'search' . Str::studly($key) . 'Attr'; if ($responses->hasMethod($method)) { - $with[] = $fieldName; + $with[] = $key; } else { - $whereKey[] = $fieldName; + $otherWhere[] = $value; } } - return [$with, $whereKey]; + return [$with, $otherWhere]; } /** * 根据搜索器获取搜索内容 - * @param array $withSearch - * @param array|null $data + * @param $where * @return BaseModel * @throws \ReflectionException + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/03/18 */ - protected function withSearchSelect(array $withSearch, ?array $data = []) + protected function withSearchSelect($where) { - [$with] = $this->getSearchData($withSearch); - return $this->getModel()->withSearch($with, $data); + [$with, $otherWhere] = $this->getSearchData($where); + return $this->getModel()->withSearch($with, $where)->where($otherWhere); } /** @@ -330,11 +335,14 @@ abstract class BaseDao * @param array $where * @return BaseModel * @throws \ReflectionException + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/03/18 */ protected function search(array $where = []) { if ($where) { - return $this->withSearchSelect(array_keys($where), $where); + return $this->withSearchSelect($where); } else { return $this->getModel(); } diff --git a/crmeb/app/listener/notice/NoticeListener.php b/crmeb/app/listener/notice/NoticeListener.php index f5c59f516..5d3618b22 100644 --- a/crmeb/app/listener/notice/NoticeListener.php +++ b/crmeb/app/listener/notice/NoticeListener.php @@ -354,7 +354,7 @@ class NoticeListener implements ListenerInterface $link = '/pages/admin/orderDetail/index?id=' . $order['order_id']; $WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link); //企业微信通知 - EnterpriseWechatJob::dispatch(['order_id' => $order['order_id']]); + EnterpriseWechatJob::dispatch([['order_id' => $order['order_id']]]); break; //确认收货给客服 case 'send_admin_confirm_take_over': @@ -371,7 +371,7 @@ class NoticeListener implements ListenerInterface $link = '/pages/admin/orderDetail/index?id=' . $order['order_id']; $WechatTemplateList->sendAdminOrder($order['order_id'], $storeName, $title, $status, $link); //企业微信通知 - EnterpriseWechatJob::dispatch(['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]); + EnterpriseWechatJob::dispatch([['storeTitle' => $storeTitle, 'order_id' => $order['order_id']]]); break; //申请退款给客服发消息 case 'send_order_apply_refund': @@ -381,7 +381,7 @@ class NoticeListener implements ListenerInterface //短信 $NoticeSms->sendAdminRefund($order); //企业微信通知 - EnterpriseWechatJob::dispatch(['order_id' => $order['order_id']]); + EnterpriseWechatJob::dispatch([['order_id' => $order['order_id']]]); //公众号 $storeName = $orderInfoServices->getCarIdByProductTitle((int)$order['id']); $title = '亲,您有个退款订单待处理!'; @@ -394,7 +394,7 @@ class NoticeListener implements ListenerInterface //站内信 $SystemMsg->kefuSystemSend($data); //企业微信通知 - EnterpriseWechatJob::dispatch($data); + EnterpriseWechatJob::dispatch([$data]); break; } diff --git a/crmeb/app/services/order/StoreOrderComputedServices.php b/crmeb/app/services/order/StoreOrderComputedServices.php index b83502338..75f19060a 100644 --- a/crmeb/app/services/order/StoreOrderComputedServices.php +++ b/crmeb/app/services/order/StoreOrderComputedServices.php @@ -391,7 +391,7 @@ class StoreOrderComputedServices extends BaseServices foreach ($temp_num as $k => $v) { if (isset($temp[$v['temp_id']]['appoint']) && $temp[$v['temp_id']]['appoint'] && isset($freeList[$v['temp_id']])) { $free = $freeList[$v['temp_id']]; - $condition = $v['type'] == 1 ? $free['number'] <= $v['number'] : $free['number'] >= $v['number']; + $condition = $free['number'] <= $v['number']; if ($free['price'] <= $v['price'] && $condition) { unset($temp_num[$k]); } diff --git a/crmeb/app/services/order/StoreOrderCreateServices.php b/crmeb/app/services/order/StoreOrderCreateServices.php index 40d6edcf4..8686d5f38 100644 --- a/crmeb/app/services/order/StoreOrderCreateServices.php +++ b/crmeb/app/services/order/StoreOrderCreateServices.php @@ -75,11 +75,11 @@ class StoreOrderCreateServices extends BaseServices $id = $snowflake->setStartTimeStamp(strtotime('2022-01-01') * 1000)->id(); } $replace = ''; - $chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; - for ($i = 0; $i < 3; $i++) { + $chars = '0123456789'; + for ($i = 0; $i < 6; $i++) { $replace .= $chars[mt_rand(0, strlen($chars) - 1)]; } - $id = substr_replace($id, $replace, -3); + $id = substr_replace($id, $replace, -6); } else { $is_callable = function ($currentTime) { $redis = Cache::store('redis'); @@ -281,10 +281,8 @@ class StoreOrderCreateServices extends BaseServices } /** @var StoreOrderCartInfoServices $cartServices */ $cartServices = app()->make(StoreOrderCartInfoServices::class); - /** @var StoreSeckillServices $seckillServices */ - $seckillServices = app()->make(StoreSeckillServices::class); $priceData['coupon_id'] = $couponId; - $order = $this->transaction(function () use ($cartIds, $orderInfo, $cartInfo, $key, $userInfo, $useIntegral, $priceData, $combinationId, $seckillId, $bargainId, $cartServices, $seckillServices, $uid, $addressId, $advanceId) { + $order = $this->transaction(function () use ($cartIds, $orderInfo, $cartInfo, $key, $userInfo, $useIntegral, $priceData, $combinationId, $seckillId, $bargainId, $cartServices, $uid, $addressId, $advanceId) { //创建订单 $order = $this->dao->save($orderInfo); if (!$order) { diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index cfb69597c..d3d3f0ba3 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -768,7 +768,7 @@ HTML; } /** @var StoreOrderCreateServices $createServices */ $createServices = app()->make(StoreOrderCreateServices::class); - $data['order_id'] = $createServices->getNewOrderId(); + $data['order_id'] = $createServices->getNewOrderId('cp'); /** @var StoreOrderStatusServices $services */ $services = app()->make(StoreOrderStatusServices::class); return $this->transaction(function () use ($id, $data, $services) { diff --git a/crmeb/app/services/product/sku/StoreProductAttrServices.php b/crmeb/app/services/product/sku/StoreProductAttrServices.php index 423d8ba02..d8473b495 100644 --- a/crmeb/app/services/product/sku/StoreProductAttrServices.php +++ b/crmeb/app/services/product/sku/StoreProductAttrServices.php @@ -90,8 +90,6 @@ class StoreProductAttrServices extends BaseServices ]; if (!$productVirtual->count(['card_no' => $items['key'], 'card_pwd' => $items['value']])) { $productVirtual->save($data); - } else { - throw new AdminException(400590, ['key' => $items['key'], 'value' => $items['value']]); } } } diff --git a/crmeb/public/install/crmeb.sql b/crmeb/public/install/crmeb.sql index e95810c91..c111a4aa5 100755 --- a/crmeb/public/install/crmeb.sql +++ b/crmeb/public/install/crmeb.sql @@ -33531,8 +33531,8 @@ INSERT INTO `eb_system_config` (`id`, `menu_name`, `type`, `input_type`, `config (429, 'get_avatar', 'radio', 'input', 7, '0=>关闭\n1=>开启', 1, '', 0, 0, '\"0\"', '强制获取昵称头像', '是否在小程序用户授权之后,弹窗获取用户的昵称和头像', 0, 1), (430, 'share_qrcode', 'radio', 'input', 2, '0=>商城\n1=>公众号', 1, '', 0, 0, '\"0\"', '公众号推广码类型', '公众号生成的推广码类型:商城:扫码直接进入商城,公众号:扫码进入公众号后推送商城的链接', 0, 1), (431, 'member_brokerage', 'radio', 'input', 73, '1=>开启\n0=>关闭', 1, '', 0, 0, '\"0\"', '购买付费会员返佣', '购买付费会员是否按照设置的佣金比例进行返佣', 98, 1), -(432, 'user_brokerage_type', 'radio', 'input', 73, '0=>按照商品价格返佣\n1=>按照实际支付价格返佣', 1, '', 0, 0, '\"0\"', '返佣类型', '选择返佣类型,按照商品价格返佣(按照商品售价计算返佣金额)以及按照实际支付价格返佣(按照商品的实际支付价格计算返佣 )', 97, 1); - +(432, 'user_brokerage_type', 'radio', 'input', 73, '0=>按照商品价格返佣\n1=>按照实际支付价格返佣', 1, '', 0, 0, '\"0\"', '返佣类型', '选择返佣类型,按照商品价格返佣(按照商品售价计算返佣金额)以及按照实际支付价格返佣(按照商品的实际支付价格计算返佣 )', 97, 1), +(433, 'network_security', 'text', 'input', 26, '', 1, '', 100, 0, '\"\"', '网安备案', '公安部门登记的备案信息,显示在pc底部', 0, 1); -- -------------------------------------------------------- -- diff --git a/crmeb/route/route.php b/crmeb/route/route.php index 3c6768124..7aecdcc86 100644 --- a/crmeb/route/route.php +++ b/crmeb/route/route.php @@ -12,18 +12,17 @@ Route::miss(function () { } switch (strtolower($appName)) { - case config('app.admin_prefix','admin'): - return view(app()->getRootPath() . 'public' . DS . 'system.html'); + case config('app.admin_prefix', 'admin'): + case 'kefu': + return view(app()->getRootPath() . 'public' . DS . 'system.html'); case 'home': if (request()->isMobile()) { return redirect(app()->route->buildUrl('/')); } else { return view(app()->getRootPath() . 'public' . DS . 'home' . DS . 'index.html'); } - case 'kefu': - return view(app()->getRootPath() . 'public' . DS . 'system.html'); case 'pages': - return view(app()->getRootPath() . 'public' .DS . 'index.html'); + return view(app()->getRootPath() . 'public' . DS . 'index.html'); default: if (!request()->isMobile() && is_dir(app()->getRootPath() . 'public' . DS . 'home') && !request()->get('type')) { return view(app()->getRootPath() . 'public' . DS . 'home' . DS . 'index.html'); diff --git a/template/admin/src/components/couponList/index.vue b/template/admin/src/components/couponList/index.vue index f14613332..cb109fef9 100644 --- a/template/admin/src/components/couponList/index.vue +++ b/template/admin/src/components/couponList/index.vue @@ -81,7 +81,7 @@ export default { isTemplate: false, loading: false, tableFrom: { - receive_type: 1, + receive_type: 3, page: 1, limit: 10, }, diff --git a/template/admin/src/components/main/components/side-menu/side-menu.less b/template/admin/src/components/main/components/side-menu/side-menu.less index 67aaf4448..af9f8bf18 100644 --- a/template/admin/src/components/main/components/side-menu/side-menu.less +++ b/template/admin/src/components/main/components/side-menu/side-menu.less @@ -7,10 +7,14 @@ .side-menu-wrapper { user-select: none; height: 100%; + ::-webkit-scrollbar{width:0;} + -ms-overflow-style: none; .menu-collapsed { height: 100%; background-color: @side-dark-theme; color: #fff !important; + overflow-y: scroll; + .ivu-dropdown { width: 100%; .ivu-dropdown-rel a { diff --git a/template/admin/src/components/sendCoupons/index.vue b/template/admin/src/components/sendCoupons/index.vue index 885b6896b..d6bbdd03b 100644 --- a/template/admin/src/components/sendCoupons/index.vue +++ b/template/admin/src/components/sendCoupons/index.vue @@ -97,7 +97,7 @@ export default { page: 1, // 当前页 limit: 15, coupon_title: '', - receive_type: 1, + receive_type: 3, }, total: 0, // 总条数 }; diff --git a/template/admin/src/pages/marketing/storeCouponIssue/create.vue b/template/admin/src/pages/marketing/storeCouponIssue/create.vue index 0d3d0beda..24c5a055a 100644 --- a/template/admin/src/pages/marketing/storeCouponIssue/create.vue +++ b/template/admin/src/pages/marketing/storeCouponIssue/create.vue @@ -18,13 +18,17 @@ + + + - 普通券 - 新人券 - - 会员券 + 手动领取 + 新用户自动发放 + 后台赠送 + 付费会员专享 +
手动领取:用户需要手动领取优惠券;新用户自动发放:新注册的用户自动发放;后台赠送:后台发放制定用户或者添加到商品里面用户购买该商品获得;付费会员专享:仅付费会员可以领取和使用
@@ -50,9 +54,6 @@
选择商品的品类
- - - 无门槛 @@ -462,4 +463,7 @@ export default { right: 0; transform: translate(50%, -50%); } +.tip { + color: #888; +} diff --git a/template/admin/src/pages/setting/setSystem/index.vue b/template/admin/src/pages/setting/setSystem/index.vue index e33952165..129e4a1b1 100644 --- a/template/admin/src/pages/setting/setSystem/index.vue +++ b/template/admin/src/pages/setting/setSystem/index.vue @@ -206,8 +206,10 @@ export default { }) .then((res) => { this.$Message.success(res.msg); - localStorage.setItem('ADMIN_TITLE', formData.site_name); - window.document.title = `${formData.site_name} - 系统设置`; + if (formData.site_name) { + localStorage.setItem('ADMIN_TITLE', formData.site_name); + window.document.title = `${formData.site_name} - 系统设置`; + } }) .catch((res) => { this.$Message.error(res.msg); @@ -224,9 +226,10 @@ export default { .fromBox { min-height: calc(100vh - 200px); - margin-top: 0px !important ; + margin-top: 0px !important; } -.article-manager /deep/ .ivu-form-item{ + +.article-manager /deep/ .ivu-form-item { margin-bottom: 20px !important; } diff --git a/template/admin/src/router/modules/frameOut.js b/template/admin/src/router/modules/frameOut.js index 609278fef..19f969461 100644 --- a/template/admin/src/router/modules/frameOut.js +++ b/template/admin/src/router/modules/frameOut.js @@ -25,16 +25,13 @@ export default [ }, // 客服 { - path: routePre + '/kefu', + path: '/kefu', name: `${pre}index`, meta: { auth: true, title: '客服管理', kefu: true, }, - redirect: { - name: `setting_service`, - }, component: () => import('@/pages/kefu/index'), }, { diff --git a/template/admin/vue.config.js b/template/admin/vue.config.js index 1de6eeb44..e7bba642d 100644 --- a/template/admin/vue.config.js +++ b/template/admin/vue.config.js @@ -2,8 +2,6 @@ const path = require('path'); const Setting = require('./src/setting.env'); // 引入打包分析文件 const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer'); -// 引入Gzip压缩文件 -const CompressionPlugin = require('compression-webpack-plugin'); // 引入js打包工具 const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); @@ -43,15 +41,6 @@ module.exports = { configureWebpack: (config) => { const pluginsPro = [new BundleAnalyzerPlugin()]; - pluginsPro.push( - new CompressionPlugin({ - algorithm: 'gzip', - test: /\.js$|\.html$|\.css$/, // 匹配文件名 - minRatio: 0.8, // 压缩率小于1才会压缩 - threshold: 10240, // 对超过10k的数据压缩 - deleteOriginalAssets: false, // 是否删除未压缩的源文件,谨慎设置,如果希望提供非gzip的资源,可不设置或者设置为false(比如删除打包后的gz后还可以加载到原始资源文件) - }), - ); pluginsPro.push( // js文件压缩 new UglifyJsPlugin({