Procházet zdrojové kódy

秒杀相关问题修复

evoxwht před 2 roky
rodič
revize
4961dca45f

+ 1 - 1
crmeb/app/adminapi/controller/v1/marketing/StoreSeckill.php

@@ -151,7 +151,7 @@ class StoreSeckill extends AuthController
     public function seckillPeople($id)
     {
         [$keyword] = $this->request->getMore([
-            ['keyword', '']
+            ['real_name', '', '', 'keyword']
         ], true);
         return app('json')->success($this->services->seckillPeople($id, $keyword));
     }

+ 2 - 1
crmeb/app/dao/order/StoreOrderDao.php

@@ -894,7 +894,7 @@ class StoreOrderDao extends BaseDao
      */
     public function seckillPeople($id, $keyword, $page = 0, $limit = 0)
     {
-        return $this->getModel()
+        return $this->getModel()->where('paid', 1)->whereIn('refund_type', [0, 3])
             ->when($id != 0, function ($query) use ($id) {
                 $query->where('seckill_id', $id);
             })->when($keyword != '', function ($query) use ($keyword) {
@@ -902,6 +902,7 @@ class StoreOrderDao extends BaseDao
             })->where('paid', 1)->field([
                 'real_name',
                 'uid',
+                'user_phone',
                 'SUM(total_num) as goods_num',
                 'COUNT(id) as order_num',
                 'SUM(pay_price) as total_price',

+ 2 - 2
crmeb/app/services/activity/seckill/StoreSeckillServices.php

@@ -362,7 +362,7 @@ class StoreSeckillServices extends BaseServices
             $header[] = ['title' => $item['value'], 'key' => 'value' . ($key + 1), 'align' => 'center', 'minWidth' => 80];
         }
         $header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
-        $header[] = ['title' => '秒杀价', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
+        $header[] = ['title' => '秒杀价', 'type' => 1, 'key' => 'price', 'align' => 'center', 'minWidth' => 80];
         $header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
         $header[] = ['title' => '原价', 'key' => 'ot_price', 'align' => 'center', 'minWidth' => 80];
         $header[] = ['title' => '库存', 'key' => 'stock', 'align' => 'center', 'minWidth' => 80];
@@ -732,7 +732,7 @@ class StoreSeckillServices extends BaseServices
         $orderServices = app()->make(StoreOrderServices::class);
         $pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1]], 'uid', false);
         $order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id]], 'uid', false);
-        $all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]]], 'pay_price');
+        $all_price = $orderServices->sum([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]], ['paid', '=', 1]], 'pay_price');
         $seckillInfo = $this->dao->get($id);
         $pay_rate = $seckillInfo['quota'] . '/' . $seckillInfo['quota_show'];
         return compact('pay_count', 'order_count', 'all_price', 'pay_rate');

+ 1 - 1
crmeb/app/services/product/product/StoreProductServices.php

@@ -950,7 +950,7 @@ class StoreProductServices extends BaseServices
         }
         $header[] = ['title' => '图片', 'slot' => 'pic', 'align' => 'center', 'minWidth' => 120];
         if ($type == 1) {
-            $header[] = ['title' => '秒杀价', 'slot' => 'price', 'align' => 'center', 'minWidth' => 80];
+            $header[] = ['title' => '秒杀价', 'type' => 1, 'key' => 'price', 'align' => 'center', 'minWidth' => 80];
             $header[] = ['title' => '成本价', 'key' => 'cost', 'align' => 'center', 'minWidth' => 80];
             $header[] = ['title' => '原价', 'key' => 'ot_price', 'align' => 'center', 'minWidth' => 80];
         } elseif ($type == 2) {