Bladeren bron

拼团问题修复

evoxwht 2 jaren geleden
bovenliggende
commit
56efb28b32

+ 13 - 1
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);
     }
 

+ 2 - 0
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();

+ 2 - 2
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();
     }
 }

+ 2 - 2
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');
     }
 

+ 3 - 0
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)
     {

+ 2 - 2
template/admin/src/pages/marketing/live/creat_live.vue

@@ -117,7 +117,7 @@
               />
             </FormItem>
           </Col>
-          <Col span="24">
+          <!-- <Col span="24">
             <FormItem label="显示样式:">
               <RadioGroup v-model="formValidate.screen_type">
                 <Radio :label="item.label" v-for="(item, index) in screen_type" :key="index">
@@ -125,7 +125,7 @@
                 </Radio>
               </RadioGroup>
             </FormItem>
-          </Col>
+          </Col> -->
           <Col span="24">
             <FormItem label="直播间类型:">
               <RadioGroup v-model="formValidate.type">

+ 2 - 2
template/admin/src/pages/marketing/storeCombination/statistics.vue

@@ -42,7 +42,7 @@
                 search
                 enter-button
                 v-model="pagination.real_name"
-                placeholder="请输入用户姓名|手机号|UID"
+                :placeholder="type == 1 ? '请输入用户|订单号|UID' : '请输入用户姓名|UID'"
                 @on-search="searchList"
               />
             </FormItem>
@@ -292,7 +292,7 @@ export default {
         },
         {
           title: '金额',
-          key: 'price',
+          key: 'total_price',
         },
         {
           title: '订单状态',