Просмотр исходного кода

Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

From-wh 2 лет назад
Родитель
Сommit
b0b4243d61

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

@@ -135,7 +135,11 @@ class StoreSeckill extends AuthController
 
     /**
      * 秒杀统计
+     * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function seckillStatistics($id)
     {

+ 9 - 0
crmeb/app/adminapi/controller/v1/order/StoreOrder.php

@@ -263,6 +263,9 @@ class StoreOrder extends AuthController
      * @param $id
      * @param StoreOrderDeliveryServices $services
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function split_delivery($id, StoreOrderDeliveryServices $services)
     {
@@ -317,7 +320,11 @@ class StoreOrder extends AuthController
 
     /**
      * 获取订单拆分子订单列表
+     * @param $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function split_order($id)
     {
@@ -455,6 +462,7 @@ class StoreOrder extends AuthController
      * 订单详情
      * @param $id 订单id
      * @return mixed
+     * @throws \ReflectionException
      */
     public function order_info($id)
     {
@@ -558,6 +566,7 @@ class StoreOrder extends AuthController
 
     /**
      * 不退款表单结构
+     * @param StoreOrderRefundServices $services
      * @param $id
      * @return mixed
      * @throws \FormBuilder\Exception\FormBuilderException

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

@@ -41,6 +41,7 @@ class StoreOrderDao extends BaseDao
      * 订单搜索
      * @param array $where
      * @return \crmeb\basic\BaseModel|mixed|\think\Model
+     * @throws \ReflectionException
      */
     public function search(array $where = [])
     {
@@ -894,7 +895,7 @@ class StoreOrderDao extends BaseDao
      */
     public function seckillPeople($id, $keyword, $page = 0, $limit = 0)
     {
-        return $this->getModel()->where('paid', 1)->whereIn('refund_type', [0, 3])
+        return $this->getModel()->where('paid', 1)->whereIn('refund_type', [0, 3])->where('is_del', 0)
             ->when($id != 0, function ($query) use ($id) {
                 $query->where('seckill_id', $id);
             })->when($keyword != '', function ($query) use ($keyword) {

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

@@ -716,6 +716,9 @@ class StoreSeckillServices extends BaseServices
      * @param $id
      * @param string $field
      * @return array|false|\PDOStatement|string|\think\Model
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function getValidProduct($id, $field = '*')
     {
@@ -724,14 +727,18 @@ class StoreSeckillServices extends BaseServices
 
     /**
      * 秒杀统计
+     * @param $id
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function seckillStatistics($id)
     {
         /** @var StoreOrderServices $orderServices */
         $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);
+        $pay_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['paid', '=', 1], ['refund_type', 'in', [0, 3]]], 'uid', false);
+        $order_count = $orderServices->getDistinctCount([['seckill_id', '=', $id], ['refund_type', 'in', [0, 3]]], 'uid', false);
         $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'];
@@ -768,6 +775,7 @@ class StoreSeckillServices extends BaseServices
         /** @var StoreOrderServices $orderServices */
         $orderServices = app()->make(StoreOrderServices::class);
         [$page, $limit] = $this->getPageValue();
+        $where['is_del'] = 0;
         $list = $orderServices->seckillOrder($id, $where, $page, $limit);
         $where['seckill_id'] = $id;
         $count = $orderServices->count($where);

+ 2 - 0
crmeb/app/services/order/StoreOrderServices.php

@@ -82,6 +82,8 @@ class StoreOrderServices extends BaseServices
     /**
      * 获取列表
      * @param array $where
+     * @param array $field
+     * @param array $with
      * @return array
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException

+ 1 - 1
crmeb/app/services/other/export/ExportServices.php

@@ -306,7 +306,7 @@ class ExportServices extends BaseServices
                     'ot_price' => $item['ot_price'],
                     'quota' => $item['quota'],
                     'start_name' => $item['start_name'],
-                    'activity_time' => date('Y-m-d H:i:s', $item['start_time']) . '至' . date('Y-m-d H:i:s', $item['stop_time']),
+                    'activity_time' => date('Y-m-d', $item['start_time']) . '至' . date('Y-m-d', $item['stop_time']),
                     'add_time' => $item['add_time']
                 ];
                 $export[] = $one_data;

+ 12 - 7
crmeb/app/services/user/UserExtractServices.php

@@ -148,11 +148,12 @@ class UserExtractServices extends BaseServices
 
     /**
      * 通过提现申请
-     * @param $id
+     * @param int $id
+     * @param $userExtract
      * @return bool
      * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
      */
     public function changeSuccess(int $id, $userExtract)
     {
@@ -164,11 +165,7 @@ class UserExtractServices extends BaseServices
         $userType = $userServices->value(['uid' => $userExtract['uid']], 'user_type');
         $nickname = $userServices->value(['uid' => $userExtract['uid']], 'nickname');
         $phone = $userServices->value(['uid' => $userExtract['uid']], 'phone');
-        event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']);
 
-        if (!$this->dao->update($id, ['status' => 1])) {
-            throw new AdminException(100007);
-        }
         switch ($userExtract['extract_type']) {
             case 'bank':
                 $order_id = $userExtract['bank_code'];
@@ -246,6 +243,12 @@ class UserExtractServices extends BaseServices
             'nickname' => $insertData['nickname'],
             'phone' => $insertData['phone']
         ], 'extract');
+
+        if (!$this->dao->update($id, ['status' => 1])) {
+            throw new AdminException(100007);
+        }
+        event('NoticeListener', [['uid' => $userExtract['uid'], 'userType' => strtolower($userType), 'extractNumber' => $extractNumber, 'nickname' => $nickname], 'user_extract']);
+
         return true;
     }
 
@@ -339,8 +342,10 @@ class UserExtractServices extends BaseServices
 
     /**
      * 通过
-     * @param $id
+     * @param int $id
      * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function adopt(int $id)
     {

+ 1 - 1
crmeb/crmeb/services/app/WechatService.php

@@ -392,7 +392,7 @@ class WechatService
         if ($result->return_code == 'SUCCESS' && $result->result_code != 'FAIL') {
             return true;
         } else {
-            throw new ApiException(410089);
+            throw new ApiException($result->err_code_des ?? 400658);
         }
     }
 

+ 1 - 3
crmeb/crmeb/services/pay/storage/V3WechatPay.php

@@ -146,7 +146,7 @@ class V3WechatPay extends BasePay implements PayInterface
      */
     public function merchantPay(string $openid, string $orderId, string $amount, array $options = [])
     {
-        $res = $this->instance->v3pay->setType($options['type'])->batches(
+        return $this->instance->v3pay->setType($options['type'])->batches(
             $orderId,
             $amount,
             $options['batch_name'],
@@ -160,8 +160,6 @@ class V3WechatPay extends BasePay implements PayInterface
                 ]
             ]
         );
-
-        return $res;
     }
 
     /**