diff --git a/crmeb/app/adminapi/controller/v1/export/ExportExcel.php b/crmeb/app/adminapi/controller/v1/export/ExportExcel.php index 10a4a1413..8ad8c1c74 100644 --- a/crmeb/app/adminapi/controller/v1/export/ExportExcel.php +++ b/crmeb/app/adminapi/controller/v1/export/ExportExcel.php @@ -110,7 +110,8 @@ class ExportExcel extends AuthController $where = $this->request->getMore([ ['store_name', ''], ['cate_id', ''], - ['type', 1] + ['type', 1], + ['ids', []] ]); return app('json')->success($this->service->exportProductList($where)); } diff --git a/crmeb/app/api/common.php b/crmeb/app/api/common.php index 28de6a816..7d8dbf991 100644 --- a/crmeb/app/api/common.php +++ b/crmeb/app/api/common.php @@ -9,35 +9,3 @@ // | Author: CRMEB Team // +---------------------------------------------------------------------- -/** - * 设置浏览信息 - * @param $uid - * @param int $product_id - * @param int $cate - * @param string $type - * @param string $content - * @param int $min - */ -function set_view($uid, $product_id = 0, $cate = 0, $type = '', $content = '', $min = 20) -{ - //TODO 待优化 - $Db = new \app\models\store\StoreVisit; - $view = $Db->where('uid', $uid)->where('product_id', $product_id)->field('count,add_time,id')->find(); - if ($view && $type != 'search') { - $time = time(); - if (($view['add_time'] + $min) < $time) { - $Db->where(['id' => $view['id']])->update(['count' => $view['count'] + 1, 'add_time' => time()]); - } - } else { - $cate = explode(',', $cate)[0]; - $Db->insert([ - 'add_time' => time(), - 'count' => 1, - 'product_id' => $product_id, - 'cate_id' => $cate, - 'type' => $type, - 'uid' => $uid, - 'content' => $content - ]); - } -} diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 378b92730..a63c2acfc 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -409,6 +409,7 @@ class StoreOrderController $uid = $type == 1 ? (int)$request->uid() : $orderInfo->uid; $orderInfo->pay_uid = $uid; $orderInfo->save(); + $orderInfo = $orderInfo->toArray(); $order = $this->services->get(['order_id' => $uni]); if (!$order) return app('json')->fail(410173); @@ -455,7 +456,7 @@ class StoreOrderController $success = app()->make(StoreOrderSuccessServices::class); $payPriceStatus = $success->zeroYuanPayment($orderInfo, $uid, $paytype); if ($payPriceStatus)//0元支付成功 - return app('json')->status('success', 410195, ['order_id' => $orderInfo['order_id'], 'key' => $orderInfo['unique ']]); + return app('json')->status('success', 410195, ['order_id' => $orderInfo['order_id'], 'key' => $orderInfo['unique']]); else return app('json')->status('pay_error'); } diff --git a/crmeb/app/api/event.php b/crmeb/app/api/event.php index 330a139c9..edd3af92c 100644 --- a/crmeb/app/api/event.php +++ b/crmeb/app/api/event.php @@ -17,8 +17,6 @@ return [ 'HttpEnd' => [], 'LogLevel' => [], 'LogWrite' => [], - 'UserLogin'=>[ -// \crmeb\listeners\user\UserLogin::class - ] + 'UserLogin'=> [] ] ]; diff --git a/crmeb/app/listener/timer/SystemTimer.php b/crmeb/app/listener/timer/SystemTimer.php index a3c0cb0fe..06a9de360 100644 --- a/crmeb/app/listener/timer/SystemTimer.php +++ b/crmeb/app/listener/timer/SystemTimer.php @@ -19,7 +19,6 @@ class SystemTimer implements ListenerInterface { public function handle($event): void { - new Crontab('*/6 * * * * *', function () { file_put_contents(runtime_path() . '.timer', time()); }); @@ -30,13 +29,9 @@ class SystemTimer implements ListenerInterface foreach ($list as &$item) { //获取定时任务时间字符串 $timeStr = $this->getTimerStr($item); -// Log::error('mark:'.$item['mark']); -// Log::error($timeStr); - + //未支付自动取消订单 if ($item['mark'] == 'order_cancel') { new Crontab($timeStr, function () { -// Log::error('每隔30秒执行一次自动取消订单 '.date('Y-m-d H:i:s')); - //未支付自动取消订单 try { /** @var StoreOrderServices $orderServices */ $orderServices = app()->make(StoreOrderServices::class); @@ -46,11 +41,9 @@ class SystemTimer implements ListenerInterface } }); } - + //拼团到期订单处理 if ($item['mark'] == 'pink_expiration') { new Crontab($timeStr, function () { -// Log::error('每隔1分钟执行一次拼团到期订单处理 '.date('Y-m-d H:i:s')); - //拼团到期订单处理 try { /** @var StorePinkServices $storePinkServices */ $storePinkServices = app()->make(StorePinkServices::class); @@ -60,11 +53,9 @@ class SystemTimer implements ListenerInterface } }); } - + //自动解绑上级绑定 if ($item['mark'] == 'agent_unbind') { new Crontab($timeStr, function () { -// Log::error('每隔1分钟执行一次自动解除上级绑定 '.date('Y-m-d H:i:s')); - //自动解绑上级绑定 try { /** @var AgentManageServices $agentManage */ $agentManage = app()->make(AgentManageServices::class); @@ -74,11 +65,9 @@ class SystemTimer implements ListenerInterface } }); } - + //更新直播商品状态 if ($item['mark'] == 'live_product_status') { new Crontab($timeStr, function () { -// Log::error('每隔3分钟执行一次更新直播商品状态 '.date('Y-m-d H:i:s')); - //更新直播商品状态 try { /** @var LiveGoodsServices $liveGoods */ $liveGoods = app()->make(LiveGoodsServices::class); @@ -88,11 +77,9 @@ class SystemTimer implements ListenerInterface } }); } - + //更新直播间状态 if ($item['mark'] == 'live_room_status') { new Crontab($timeStr, function () { -// Log::error('每隔3分钟执行一次更新直播间状态 '.date('Y-m-d H:i:s')); - //更新直播间状态 try { /** @var LiveRoomServices $liveRoom */ $liveRoom = app()->make(LiveRoomServices::class); @@ -102,11 +89,9 @@ class SystemTimer implements ListenerInterface } }); } - + //自动收货 if ($item['mark'] == 'take_delivery') { new Crontab($timeStr, function () { -// Log::error('每隔5分钟执行一次自动收货 '.date('Y-m-d H:i:s')); - //自动收货 try { /** @var StoreOrderTakeServices $services */ $services = app()->make(StoreOrderTakeServices::class); @@ -116,11 +101,9 @@ class SystemTimer implements ListenerInterface } }); } - + //查询预售到期商品自动下架 if ($item['mark'] == 'advance_off') { new Crontab($timeStr, function () { -// Log::error('每隔5分钟执行一次查询预售到期商品自动下架 '.date('Y-m-d H:i:s')); - //查询预售到期商品自动下架 try { /** @var StoreProductServices $product */ $product = app()->make(StoreProductServices::class); @@ -130,11 +113,9 @@ class SystemTimer implements ListenerInterface } }); } - + //自动好评 if ($item['mark'] == 'product_replay') { new Crontab($timeStr, function () { -// Log::error('每隔5分钟执行一次自动好评 '.date('Y-m-d H:i:s')); - //自动好评 try { /** @var StoreOrderServices $orderServices */ $orderServices = app()->make(StoreOrderServices::class); @@ -144,11 +125,9 @@ class SystemTimer implements ListenerInterface } }); } - + //清除昨日海报 if ($item['mark'] == 'clear_poster') { new Crontab($timeStr, function () { -// Log::error('每天0时30分0秒执行一次清除昨日海报 '.date('Y-m-d H:i:s')); - //清除昨日海报 try { /** @var SystemAttachmentServices $attach */ $attach = app()->make(SystemAttachmentServices::class); @@ -160,33 +139,47 @@ class SystemTimer implements ListenerInterface } } } - + /** + * 0 1 2 3 4 5 + | | | | | | + | | | | | +------ day of week (0 - 6) (Sunday=0) + | | | | +------ month (1 - 12) + | | | +-------- day of month (1 - 31) + | | +---------- hour (0 - 23) + | +------------ min (0 - 59) + +-------------- sec (0-59)[可省略,如果没有0位,则最小时间粒度是分钟] + */ + /** + * 获取定时任务时间表达式 + * @param $data + * @return string + */ public function getTimerStr($data): string { $timeStr = ''; switch ($data['type']) { - case 1: + case 1:// 每隔几秒 $timeStr = '*/' . $data['second'] . ' * * * * *'; break; - case 2: + case 2:// 每隔几分 $timeStr = '0 */' . $data['minute'] . ' * * * *'; break; - case 3: - $timeStr = '0 0 */' . $data['hour'] . ' * * *'; + case 3:// 每隔几时第几分钟执行 + $timeStr = '0 ' . $data['minute'] . ' */' . $data['hour'] . ' * * *'; break; - case 4: - $timeStr = '0 0 0 */' . $data['day'] . ' * *'; + case 4:// 每隔几日第几小时第几分钟执行 + $timeStr = '0 ' . $data['minute'] . ' ' . $data['hour'] . ' */' . $data['day'] . ' * *'; break; - case 5: + case 5:// 每日几时几分几秒 $timeStr = $data['second'] . ' ' . $data['minute'] . ' ' . $data['hour'] . ' * * *'; break; - case 6: + case 6:// 每周周几几时几分几秒 $timeStr = $data['second'] . ' ' . $data['minute'] . ' ' . $data['hour'] . ' * * ' . ($data['week'] == 7 ? 0 : $data['week']); break; - case 7: + case 7:// 每月几日几时几分几秒 $timeStr = $data['second'] . ' ' . $data['minute'] . ' ' . $data['hour'] . ' ' . $data['day'] . ' * *'; break; } return $timeStr; } -} \ No newline at end of file +} diff --git a/crmeb/app/model/product/product/StoreProduct.php b/crmeb/app/model/product/product/StoreProduct.php index 0ac70cff7..ef2616a9d 100644 --- a/crmeb/app/model/product/product/StoreProduct.php +++ b/crmeb/app/model/product/product/StoreProduct.php @@ -338,6 +338,16 @@ class StoreProduct extends BaseModel } } + /** + * 不在当前id中查询 + * @param $query + * @param $value + */ + public function searchIdsAttr($query, $value) + { + if ($value != '') $query->whereIn('id', $value); + } + /** * 不在当前id中查询 * @param $query diff --git a/crmeb/app/services/order/StoreOrderRefundServices.php b/crmeb/app/services/order/StoreOrderRefundServices.php index 4290ee77b..9e646ea2b 100644 --- a/crmeb/app/services/order/StoreOrderRefundServices.php +++ b/crmeb/app/services/order/StoreOrderRefundServices.php @@ -998,8 +998,6 @@ class StoreOrderRefundServices extends BaseServices $res4 = $res4 && $storeOrderCartInfoServices->update(['oid' => $id, 'cart_id' => $cart['cart_id']], ['refund_num' => (($cartInfo[$cart['cart_id']]['refund_num'] ?? 0) + $cart['cart_num'])]); } } else { - //修改原订单状态 - $res2 = false !== $orderServices->update(['id' => $order['id']], ['refund_status' => 1]); foreach ($cartInfos as $cart) { $res4 = $res4 && $storeOrderCartInfoServices->update(['oid' => $id, 'cart_id' => $cart['cart_id']], ['refund_num' => $cart['cart_num']]); } diff --git a/crmeb/app/services/product/product/StoreProductServices.php b/crmeb/app/services/product/product/StoreProductServices.php index f6c796b9f..e37745d78 100644 --- a/crmeb/app/services/product/product/StoreProductServices.php +++ b/crmeb/app/services/product/product/StoreProductServices.php @@ -93,8 +93,14 @@ class StoreProductServices extends BaseServices /** * 获取列表 - * @param $where + * @param array $where * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author 吴汐 + * @email 442384644@qq.com + * @date 2023/02/17 */ public function getList(array $where) { diff --git a/crmeb/app/services/user/UserAuthServices.php b/crmeb/app/services/user/UserAuthServices.php index 2ebea98d4..b864e2fb9 100644 --- a/crmeb/app/services/user/UserAuthServices.php +++ b/crmeb/app/services/user/UserAuthServices.php @@ -70,7 +70,7 @@ class UserAuthServices extends BaseServices throw new AuthException(110003); } - $user = $this->dao->get(['uid' => $id, 'is_del' => 0]); + $user = $this->dao->get(['uid' => $id, 'is_del' => 0, 'status' => 1]); if (!$user || $user->uid != $tokenData['uid']) { if (!request()->isCli()) CacheService::delete($md5Token); diff --git a/template/admin/src/pages/product/productList/index.vue b/template/admin/src/pages/product/productList/index.vue index 5a34094b4..f900b14af 100644 --- a/template/admin/src/pages/product/productList/index.vue +++ b/template/admin/src/pages/product/productList/index.vue @@ -561,6 +561,7 @@ export default { let excelData = JSON.parse(JSON.stringify(this.artFrom)); excelData.page = 1; excelData.limit = 50; + excelData.ids = this.ids; for (let i = 0; i < excelData.page + 1; i++) { let lebData = await this.getExcelData(excelData); if (!fileName) fileName = lebData.filename; diff --git a/template/admin/src/pages/setting/devise/list.vue b/template/admin/src/pages/setting/devise/list.vue index cdeb8f1a7..743f0210b 100644 --- a/template/admin/src/pages/setting/devise/list.vue +++ b/template/admin/src/pages/setting/devise/list.vue @@ -291,6 +291,12 @@ export default { cancel() { this.$refs['formItem'].resetFields(); }, + refreshFrame() { + this.imgUrl = ''; + setTimeout((e) => { + this.imgUrl = `${location.origin}/pages/index/index?type=iframeWindow`; + }, 200); + }, getChildData(e) { this.loadingExist = e; }, @@ -454,26 +460,10 @@ export default { type: 1, }) .then((res) => { + this.refreshFrame(); this.$Message.success(res.msg); this.$Modal.remove(); this.getList(); - // if (res.data.status) { - // this.$Message.success(res.data.msg); - // this.$Modal.remove(); - // this.getList(); - // } else { - // setTimeout((e) => { - // this.$Modal.confirm({ - // title: "提示", - // content: "

尚未安装模板,请购买安装后再试!

", - // loading: false, - // okText: "点击购买", - // onOk: () => { - // window.open("http://s.crmeb.com/goods_cate", `_blank`); - // }, - // }); - // }, 200); - // } }) .catch((res) => { this.$Modal.remove(); diff --git a/template/admin/src/pages/system/crontab/createModal.vue b/template/admin/src/pages/system/crontab/createModal.vue index 0d870123d..4c98abfac 100644 --- a/template/admin/src/pages/system/crontab/createModal.vue +++ b/template/admin/src/pages/system/crontab/createModal.vue @@ -40,13 +40,13 @@ 日 - +
时
- +
diff --git a/template/uni-app/pages/activity/goods_combination_status/index.vue b/template/uni-app/pages/activity/goods_combination_status/index.vue index c50e7d1bd..943efb211 100644 --- a/template/uni-app/pages/activity/goods_combination_status/index.vue +++ b/template/uni-app/pages/activity/goods_combination_status/index.vue @@ -660,9 +660,8 @@ .then(res => { that.$util.Tips({ title: res.msg - }, { - tab: 3 }); + this.getCombinationPink() }) .catch(res => { that.$util.Tips({ diff --git a/template/uni-app/pages/admin/statistics/index.vue b/template/uni-app/pages/admin/statistics/index.vue index 4fca25e4a..b83c4a3dd 100644 --- a/template/uni-app/pages/admin/statistics/index.vue +++ b/template/uni-app/pages/admin/statistics/index.vue @@ -49,7 +49,7 @@
- {{$t(`单位`)}}({{where.type == 1?$t(`元.`):$t(`分.`)}}) + {{$t(`单位`)}}({{where.type == 1?$t(`元.`):$t(`份`)}})