diff --git a/crmeb/app/adminapi/controller/v1/export/ExportExcel.php b/crmeb/app/adminapi/controller/v1/export/ExportExcel.php index 0fc03b224..3dd393675 100644 --- a/crmeb/app/adminapi/controller/v1/export/ExportExcel.php +++ b/crmeb/app/adminapi/controller/v1/export/ExportExcel.php @@ -72,7 +72,8 @@ class ExportExcel extends AuthController ['label_id', ''], ['now_money', 'normal'], ['field_key', ''], - ['isMember', ''] + ['isMember', ''], + ['ids', []] ]); return app('json')->success($this->service->exportUserList($where)); } diff --git a/crmeb/app/adminapi/controller/v1/marketing/StoreCombination.php b/crmeb/app/adminapi/controller/v1/marketing/StoreCombination.php index 11449be1c..a02808cd6 100644 --- a/crmeb/app/adminapi/controller/v1/marketing/StoreCombination.php +++ b/crmeb/app/adminapi/controller/v1/marketing/StoreCombination.php @@ -182,7 +182,11 @@ class StoreCombination extends AuthController /** * 拼团人列表 + * @param $id * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function order_pink($id) { @@ -207,12 +211,20 @@ class StoreCombination extends AuthController * 活动参与人 * @param $id * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function combinationStatisticsList($id) { + $where = $this->request->getMore([ + ['real_name', '', '', 'keyword'], + ['status', ''] + ]); + $where['cid'] = $id; /** @var StorePinkServices $storePinkServices */ $storePinkServices = app()->make(StorePinkServices::class); - $list = $storePinkServices->systemPage(['cid' => $id]); + $list = $storePinkServices->systemPage($where); return app('json')->success($list); } diff --git a/crmeb/app/adminapi/controller/v1/user/UserLabel.php b/crmeb/app/adminapi/controller/v1/user/UserLabel.php index 034fc7736..f61f4077f 100644 --- a/crmeb/app/adminapi/controller/v1/user/UserLabel.php +++ b/crmeb/app/adminapi/controller/v1/user/UserLabel.php @@ -37,7 +37,11 @@ class UserLabel extends AuthController /** * 标签列表 + * @param int $label_cate * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function index($label_cate = 0) { @@ -60,8 +64,10 @@ class UserLabel extends AuthController /** * 保存标签表单数据 - * @param int $id * @return mixed + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function save() { diff --git a/crmeb/app/api/controller/v1/admin/StoreOrderController.php b/crmeb/app/api/controller/v1/admin/StoreOrderController.php index f966fd6c4..17ab9ec7d 100644 --- a/crmeb/app/api/controller/v1/admin/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/admin/StoreOrderController.php @@ -238,7 +238,7 @@ class StoreOrderController $start = $middle; } $space = bcsub($stop, $start, 0);//间隔时间段 - $front = bcsub($start, $space, 0);//第一个时间段 + $front = bcsub($start, $space, 0) - 1;//第一个时间段 /** @var StoreOrderServices $orderService */ $orderService = app()->make(StoreOrderServices::class); $order_where = [ @@ -246,10 +246,11 @@ class StoreOrderController 'paid' => 1, 'refund_status' => [0, 3], 'is_del' => 0, - 'is_system_del' => 0]; + 'is_system_del' => 0 + ]; if ($type == 1) {//销售额 - $frontPrice = $orderService->sum($order_where + ['time' => [$front, $start]], 'pay_price', true); + $frontPrice = $orderService->sum($order_where + ['time' => [$front, $start - 1]], 'pay_price', true); $afterPrice = $orderService->sum($order_where + ['time' => [$start, $stop]], 'pay_price', true); $chartInfo = $orderService->chartTimePrice($start, $stop); $data['chart'] = $chartInfo;//营业额图表数据 @@ -262,7 +263,7 @@ class StoreOrderController $data['increase_time'] = abs($increase); //同比上个时间区间增长营业额 $data['increase_time_status'] = $increase >= 0 ? 1 : 2; //同比上个时间区间增长营业额增长 1 减少 2 } else {//订单数 - $frontNumber = $orderService->count($order_where + ['time' => [$front, $start]]); + $frontNumber = $orderService->count($order_where + ['time' => [$front, $start - 1]]); $afterNumber = $orderService->count($order_where + ['time' => [$start, $stop]]); $chartInfo = $orderService->chartTimeNumber($start, $stop); $data['chart'] = $chartInfo;//订单数图表数据 diff --git a/crmeb/app/dao/activity/combination/StorePinkDao.php b/crmeb/app/dao/activity/combination/StorePinkDao.php index 042272623..433086504 100644 --- a/crmeb/app/dao/activity/combination/StorePinkDao.php +++ b/crmeb/app/dao/activity/combination/StorePinkDao.php @@ -56,6 +56,8 @@ class StorePinkDao extends BaseDao { return $this->search($where)->when($where['k_id'] != 0, function ($query) use ($where) { $query->whereOr('id', $where['k_id']); + })->when(isset($where['keyword']) && $where['keyword'] != '', function ($query) use ($where) { + $query->where('uid|nickname', 'like', '%' . $where['keyword'] . '%'); })->with('getProduct')->when($page != 0, function ($query) use ($page, $limit) { $query->page($page, $limit); })->order('add_time desc')->select()->toArray(); diff --git a/crmeb/app/dao/order/StoreOrderDao.php b/crmeb/app/dao/order/StoreOrderDao.php index 166e5a6df..a32c3f941 100644 --- a/crmeb/app/dao/order/StoreOrderDao.php +++ b/crmeb/app/dao/order/StoreOrderDao.php @@ -967,9 +967,9 @@ class StoreOrderDao extends BaseDao */ public function combinationStatisticsOrder($id, $where, $page = 0, $limit = 0) { - return $this->search($where)->where('combination_id', $id) + return $this->search($where)->where('combination_id', $id)->where('paid', 1)->whereIn('refund_type', [0, 3])->where('is_del', 0) ->when($page && $limit, function ($query) use ($page, $limit) { $query->page($page, $limit); - })->field(['order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->select()->toArray(); + })->field(['uid', 'order_id', 'real_name', 'status', 'pay_price', 'total_num', 'add_time', 'pay_time', 'paid'])->order('add_time desc')->select()->toArray(); } } diff --git a/crmeb/app/dao/user/UserWechatUserDao.php b/crmeb/app/dao/user/UserWechatUserDao.php index 20cddac5b..914c86641 100644 --- a/crmeb/app/dao/user/UserWechatUserDao.php +++ b/crmeb/app/dao/user/UserWechatUserDao.php @@ -244,6 +244,10 @@ class UserWechatUserDao extends BaseDao if (isset($where['is_del'])) { $model->where($userAlias . 'is_del', $where['is_del']); } + + if (isset($where['ids']) && count($where['ids'])) { + $model->whereIn($userAlias . 'uid', $where['ids']); + } return $field ? $model->field($field) : $model; } diff --git a/crmeb/app/services/activity/combination/StoreCombinationServices.php b/crmeb/app/services/activity/combination/StoreCombinationServices.php index 07b7f34ec..a894d7789 100644 --- a/crmeb/app/services/activity/combination/StoreCombinationServices.php +++ b/crmeb/app/services/activity/combination/StoreCombinationServices.php @@ -643,8 +643,8 @@ class StoreCombinationServices extends BaseServices $spread_count = $pinkServices->getDistinctCount([['cid', '=', $id], ['k_id', '>', 0]], 'uid', false); $start_count = $pinkServices->count(['cid' => $id, 'k_id' => 0]); $success_count = $pinkServices->count(['cid' => $id, 'k_id' => 0, 'status' => 2]); - $pay_price = $orderServices->sum(['combination_id' => $id, 'paid' => 1], 'pay_price', true); - $pay_count = $orderServices->getDistinctCount([['combination_id', '=', $id], ['paid', '=', 1]], 'uid', false); + $pay_price = $orderServices->sum([['combination_id', '=', $id], ['paid', '=', 1], ['refund_type', 'in', [0, 3]], ['is_del', '=', 0]], 'pay_price', false); + $pay_count = $orderServices->getDistinctCount([['combination_id', '=', $id], ['paid', '=', 1], ['refund_type', 'in', [0, 3]], ['is_del', '=', 0]], 'uid', false); return compact('people_count', 'spread_count', 'start_count', 'success_count', 'pay_price', 'pay_count'); } diff --git a/crmeb/app/services/activity/combination/StorePinkServices.php b/crmeb/app/services/activity/combination/StorePinkServices.php index 535ab831b..4da1e716c 100644 --- a/crmeb/app/services/activity/combination/StorePinkServices.php +++ b/crmeb/app/services/activity/combination/StorePinkServices.php @@ -56,6 +56,9 @@ class StorePinkServices extends BaseServices /** * @param array $where * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function systemPage(array $where) { diff --git a/crmeb/app/services/activity/integral/StoreIntegralOrderServices.php b/crmeb/app/services/activity/integral/StoreIntegralOrderServices.php index c36a1b39f..b7d778696 100644 --- a/crmeb/app/services/activity/integral/StoreIntegralOrderServices.php +++ b/crmeb/app/services/activity/integral/StoreIntegralOrderServices.php @@ -160,8 +160,7 @@ class StoreIntegralOrderServices extends BaseServices if (!$addressId) { throw new ApiException(410045); } - if (!$addressInfo = $addressServices->getOne(['uid' => $uid, 'id' => $addressId, 'is_del' => 0])) - throw new ApiException(410046); + if (!$addressInfo = $addressServices->getOne(['uid' => $uid, 'id' => $addressId, 'is_del' => 0])) throw new ApiException(410046); $addressInfo = $addressInfo->toArray(); $total_price = bcmul($productInfo['price'], $num, 2); /** @var UserBillServices $userBillServices */ @@ -226,7 +225,7 @@ class StoreIntegralOrderServices extends BaseServices $res2 = false !== $userServices->bcDec($userInfo['uid'], 'integral', $priceIntegral, 'uid'); /** @var UserBillServices $userBillServices */ $userBillServices = app()->make(UserBillServices::class); - $res3 = $userBillServices->income('storeIntegral_use_integral', $uid, $priceIntegral, $userInfo['integral'], $orderId); + $res3 = $userBillServices->income('storeIntegral_use_integral', $uid, $priceIntegral, $userInfo['integral'] - $priceIntegral, $orderId); $res2 = $res2 && false != $res3; } if (!$res2) { @@ -334,7 +333,7 @@ class StoreIntegralOrderServices extends BaseServices /** @var StoreProductAttrValueServices $StoreProductAttrValueServices */ $StoreProductAttrValueServices = app()->make(StoreProductAttrValueServices::class); $attrValue = $StoreProductAttrValueServices->uniqueByField($unique, 'product_id,suk,price,image,unique'); - if(!$attrValue || !isset($attrValue['storeIntegral']) || !$attrValue['storeIntegral']){ + if (!$attrValue || !isset($attrValue['storeIntegral']) || !$attrValue['storeIntegral']) { throw new ApiException(410295); } $data = []; @@ -734,7 +733,7 @@ class StoreIntegralOrderServices extends BaseServices if (!$remark) throw new AdminException(400106); if (!$id) throw new AdminException(100100); if (!$order = $this->dao->get($id)) { - throw new AdminException(100025); + throw new AdminException(100025); } $order->remark = $remark; diff --git a/crmeb/app/services/order/StoreOrderRefundServices.php b/crmeb/app/services/order/StoreOrderRefundServices.php index b0926ab9c..9acc00b13 100644 --- a/crmeb/app/services/order/StoreOrderRefundServices.php +++ b/crmeb/app/services/order/StoreOrderRefundServices.php @@ -245,7 +245,7 @@ class StoreOrderRefundServices extends BaseServices $this->storeOrderServices->update($splitOrderInfo['id'], [ 'status' => -2, 'refund_status' => 2, - 'refund_type' => $orderRefundInfo['refund_type'], + 'refund_type' => 6, 'refund_express' => $orderRefundInfo['refund_express'], 'refund_express_name' => $orderRefundInfo['refund_express_name'], 'refund_reason_wap_img' => $orderRefundInfo['refund_img'], diff --git a/template/admin/src/pages/kefu/index.vue b/template/admin/src/pages/kefu/index.vue index a074a1d6b..1cb469f13 100644 --- a/template/admin/src/pages/kefu/index.vue +++ b/template/admin/src/pages/kefu/index.vue @@ -548,7 +548,9 @@ a:link, a:visited, a:hover, a:active { background-position: left top !important; display: flex; } - + .wrapper-box .foot-box { + text-align: center !important; + } .content { display: none; } diff --git a/template/admin/src/pages/marketing/live/add_goods.vue b/template/admin/src/pages/marketing/live/add_goods.vue index cfb55274f..5d9fb61ca 100644 --- a/template/admin/src/pages/marketing/live/add_goods.vue +++ b/template/admin/src/pages/marketing/live/add_goods.vue @@ -24,7 +24,7 @@