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/dao/activity/combination/StorePinkDao.php b/crmeb/app/dao/activity/combination/StorePinkDao.php index e77b4458a..6f3ad7cf0 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, false)->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 c95e14f9e..cbefd5a5d 100644 --- a/crmeb/app/dao/order/StoreOrderDao.php +++ b/crmeb/app/dao/order/StoreOrderDao.php @@ -968,9 +968,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/services/activity/combination/StoreCombinationServices.php b/crmeb/app/services/activity/combination/StoreCombinationServices.php index d38bf9777..4e2115fff 100644 --- a/crmeb/app/services/activity/combination/StoreCombinationServices.php +++ b/crmeb/app/services/activity/combination/StoreCombinationServices.php @@ -644,8 +644,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/template/admin/src/pages/marketing/live/creat_live.vue b/template/admin/src/pages/marketing/live/creat_live.vue index 4b5e22794..8f64caad3 100644 --- a/template/admin/src/pages/marketing/live/creat_live.vue +++ b/template/admin/src/pages/marketing/live/creat_live.vue @@ -117,7 +117,7 @@ /> -