12 Commits 0b8f230417 ... 54006fc8f1

Author SHA1 Message Date
  gorden 54006fc8f1 完善页面功能 1 month ago
  gorden b22ee669e1 退款到福利账户、VIP账户 1 month ago
  gorden b2dda52796 卡券调整 1 month ago
  gorden 140d74f9ba 卡券调整 1 month ago
  gorden 63d157501d 序列搜索 1 month ago
  gorden 768456a8d5 会员身份 1 month ago
  gorden 77b263b441 控制台退款金额 1 month ago
  gorden a8daaaca51 积分管理 1 month ago
  gorden 5d30385026 Merge branch 'master' into dev 1 month ago
  gorden 37746bc6f1 福利账户清零功能 1 month ago
  gorden e0ab9eb944 福利账户清零功能 1 month ago
  gorden ec21ce495d 页面调整 1 month ago

+ 1 - 1
app/admin/controller/client/EvaluateController.php

@@ -154,7 +154,7 @@ class EvaluateController extends Curd
 
 
         if (!empty($evaluate->info)){
         if (!empty($evaluate->info)){
             $evaluate->info->member_info_headimg = $evaluate->info->member_info_headimg ?? getenv('STORAGE_DOMAIN').'/images/avatar_default.png';
             $evaluate->info->member_info_headimg = $evaluate->info->member_info_headimg ?? getenv('STORAGE_DOMAIN').'/images/avatar_default.png';
-            $evaluate->info->member_info_nickname ?? substr($evaluate->member->member_mobile,-4).'用户';
+            $evaluate->info->member_info_nickname ?? substr($evaluate->member->member_mobile,-4).'会员';
         }
         }
         if (!empty($evaluate->goods)){
         if (!empty($evaluate->goods)){
             $evaluate->goods->goods_cover = getenv('STORAGE_DOMAIN').$evaluate->goods->goods_cover;
             $evaluate->goods->goods_cover = getenv('STORAGE_DOMAIN').$evaluate->goods->goods_cover;

+ 16 - 0
app/admin/controller/client/PointsController.php

@@ -72,4 +72,20 @@ class PointsController extends Curd
         }
         }
         return $model;
         return $model;
     }
     }
+
+    /**
+     * @Desc 积分详情
+     * @Author Gorden
+     * @Date 2024/9/19 18:16
+     *
+     * @param Request $request
+     * @return Response
+     */
+    public function info(Request $request): Response
+    {
+        $pointsId = $request->get('points_id');
+        if (!$pointsId){
+            return json_fail('参数异常');
+        }
+    }
 }
 }

+ 40 - 17
app/admin/controller/coupon/CouponController.php

@@ -403,41 +403,46 @@ class CouponController extends Curd
                                     $val = $periodJson['val'] - 1;
                                     $val = $periodJson['val'] - 1;
                                     if ($val < 1) {
                                     if ($val < 1) {
                                         $params['coupon_detail_deadline_datetime'] = date('Y-m-d 23:59:59');
                                         $params['coupon_detail_deadline_datetime'] = date('Y-m-d 23:59:59');
-                                    }else{
-                                        $params['coupon_detail_deadline_datetime'] = date('Y-m-t 23:59:59',strtotime("+".$val." day"));
+                                    } else {
+                                        $params['coupon_detail_deadline_datetime'] = date('Y-m-t 23:59:59', strtotime("+" . $val . " day"));
                                     }
                                     }
                                 } elseif ($periodJson['unit'] == 'week') {
                                 } elseif ($periodJson['unit'] == 'week') {
                                     $val = $periodJson['val'] - 1;
                                     $val = $periodJson['val'] - 1;
-                                    if ($val < 1){
+                                    if ($val < 1) {
                                         $params['coupon_detail_deadline_datetime'] = date('Y-m-d 23:59:59', strtotime('this week Sunday'));
                                         $params['coupon_detail_deadline_datetime'] = date('Y-m-d 23:59:59', strtotime('this week Sunday'));
-                                    }else{
-                                        $params['coupon_detail_deadline_datetime'] = date('Y-m-t 23:59:59',strtotime("+".$val.' week',date('Y-m-d',strtotime("+".$val." month"))));
+                                    } else {
+                                        $params['coupon_detail_deadline_datetime'] = date('Y-m-t 23:59:59', strtotime("+" . $val . ' week', date('Y-m-d', strtotime("+" . $val . " month"))));
                                     }
                                     }
-                                } elseif ($periodJson['unit'] == 'month'){
+                                } elseif ($periodJson['unit'] == 'month') {
                                     $val = $periodJson['val'] - 1;
                                     $val = $periodJson['val'] - 1;
-                                    if ($val < 1){
+                                    if ($val < 1) {
                                         $params['coupon_detail_deadline_datetime'] = date('Y-m-t 23:59:59');
                                         $params['coupon_detail_deadline_datetime'] = date('Y-m-t 23:59:59');
-                                    }else{
-                                        $params['coupon_detail_deadline_datetime'] = date('Y-m-t 23:59:59',strtotime("+".$val." month"));
+                                    } else {
+                                        $params['coupon_detail_deadline_datetime'] = date('Y-m-t 23:59:59', strtotime("+" . $val . " month"));
                                     }
                                     }
                                 }
                                 }
                             }
                             }
                             if ($chooseCoupon['nbr'] > 0) {
                             if ($chooseCoupon['nbr'] > 0) {
                                 // 有发行数量
                                 // 有发行数量
                                 if ($coupon['coupon_number'] != 0) {
                                 if ($coupon['coupon_number'] != 0) {
-                                    // 查询共发行了多少张了
-                                    $count = CouponDetail::where('join_detail_coupon_id', $coupon['coupon_id'])->count();
+                                    // 查询还有多少张没领的
+                                    $count = CouponDetail::where('join_detail_coupon_id', $coupon['coupon_id'])
+                                        ->whereIn('coupon_detail_status',['INIT','PENDING'])
+                                        ->count();
                                     if (!isset($couponNbr[$coupon['coupon_id']])) {
                                     if (!isset($couponNbr[$coupon['coupon_id']])) {
                                         $couponNbr[$coupon['coupon_id']] = $count;
                                         $couponNbr[$coupon['coupon_id']] = $count;
                                     }
                                     }
-                                    if ($couponNbr[$coupon['coupon_id']] + $chooseCoupon['nbr'] > $coupon['coupon_number']) {
+                                    if ($couponNbr[$coupon['coupon_id']] - $chooseCoupon['nbr'] < 0) {
                                         throw new BusinessException($coupon['coupon_name'] . "超出发行数量");
                                         throw new BusinessException($coupon['coupon_name'] . "超出发行数量");
                                     }
                                     }
-                                    $couponNbr[$coupon['coupon_id']] = $couponNbr[$coupon['coupon_id']] + $chooseCoupon['nbr'];
-                                }
-
-                                for ($i = 0; $i < $chooseCoupon['nbr']; $i++) {
-                                    CouponDetailService::customSendCoupon($params);
+                                    $couponNbr[$coupon['coupon_id']] = $couponNbr[$coupon['coupon_id']] - $chooseCoupon['nbr'];
+                                    $params['chooseCouponNbr'] = $chooseCoupon['nbr'];
+                                    // 匹配已发行的优惠券
+                                    CouponDetailService::customSendCouponHave($params);
+                                }else{
+                                    for ($i = 0; $i < $chooseCoupon['nbr']; $i++) {
+                                        CouponDetailService::customSendCoupon($params);
+                                    }
                                 }
                                 }
                             }
                             }
                         }
                         }
@@ -852,6 +857,24 @@ class CouponController extends Curd
         }
         }
     }
     }
 
 
+    public function disableCoupon(Request $request)
+    {
+        $couponId = $request->post('coupon_id');
+        if (!$couponId){
+            return json_fail("参数异常");
+        }
+        Db::beginTransaction();
+        try {
+            Coupon::where('coupon_id',$couponId)->update(['coupon_status'=>'DISABLED']);
+            CouponDetail::where('join_detail_coupon_id',$couponId)->whereIn('coupon_detail_status',['INIT','PENDING'])->update(['coupon_detail_status'=>'DISABLED']);
+            Db::commit();
+            return json_success('success');
+        }catch (\Exception $e){
+            Db::rollBack();
+            return json_fail("禁用失败");
+        }
+    }
+
     private function generateCouponDetail($couponId, $couponStatus, $nbr)
     private function generateCouponDetail($couponId, $couponStatus, $nbr)
     {
     {
         for ($i = 0; $i < intval($nbr); $i++) {
         for ($i = 0; $i < intval($nbr); $i++) {

+ 14 - 0
app/admin/controller/coupon/CouponPacketSequenceController.php

@@ -41,6 +41,13 @@ class CouponPacketSequenceController extends Curd
 
 
             $where['coupon_packet_sequence_addtimes'] = $addTimes;
             $where['coupon_packet_sequence_addtimes'] = $addTimes;
         }
         }
+        $usedTime = $request->get('coupon_packet_sequence_used_datetime', []);
+        if (!empty($usedTime)) {
+            $usedTime[0] = isset($usedTime[0]) ? strtotime($usedTime[0]) : time();
+            $usedTime[1] = isset($usedTime[1]) ? strtotime($usedTime[1]) : time();
+
+            $where['coupon_packet_sequence_used_datetime'] = $usedTime;
+        }
 
 
         $query = $this->doSelect($where, $field, $order);
         $query = $this->doSelect($where, $field, $order);
         return $this->doFormat($query, $format, $limit);
         return $this->doFormat($query, $format, $limit);
@@ -48,6 +55,10 @@ class CouponPacketSequenceController extends Curd
 
 
     protected function doSelect(array $where, string $field = null, string $order = 'desc')
     protected function doSelect(array $where, string $field = null, string $order = 'desc')
     {
     {
+        if (!empty($where['coupon_packet_sequence_used_datetime'])) {
+            $usedTime = $where['coupon_packet_sequence_used_datetime'];
+            unset($where['coupon_packet_sequence_used_datetime']);
+        }
         $model = $this->model->with([
         $model = $this->model->with([
             'packet' => function ($query) {
             'packet' => function ($query) {
                 $query->select('coupon_packet_id', 'coupon_packet_name');
                 $query->select('coupon_packet_id', 'coupon_packet_name');
@@ -91,6 +102,9 @@ class CouponPacketSequenceController extends Curd
                 $model = $model->where($column, $value);
                 $model = $model->where($column, $value);
             }
             }
         }
         }
+        if (!empty($usedTime)) {
+            $model = $model->whereRaw("UNIX_TIMESTAMP(coupon_packet_sequence_used_datetime) >= ? AND UNIX_TIMESTAMP(coupon_packet_sequence_used_datetime) <= ?", [$usedTime[0], $usedTime[1]]);
+        }
 //        $model = $model->selectRaw('join_detail_coupon_id,join_coupon_detail_member_id,MAX(coupon_detail_addtimes) as coupon_detail_addtimes,COUNT(*) as total');
 //        $model = $model->selectRaw('join_detail_coupon_id,join_coupon_detail_member_id,MAX(coupon_detail_addtimes) as coupon_detail_addtimes,COUNT(*) as total');
 //        $model = $model->groupBy('join_coupon_detail_member_id', 'join_detail_coupon_id');
 //        $model = $model->groupBy('join_coupon_detail_member_id', 'join_detail_coupon_id');
         if ($field) {
         if ($field) {

+ 29 - 1
app/admin/controller/member/MemberController.php

@@ -370,7 +370,7 @@ class MemberController
 
 
     public function welfareInfo(Request $request)
     public function welfareInfo(Request $request)
     {
     {
-        $memberId = $request->get('member_id', '');
+        $memberId = $request->get('member_id');
         if (!$memberId) {
         if (!$memberId) {
             return json_fail("参数错误");
             return json_fail("参数错误");
         }
         }
@@ -378,6 +378,34 @@ class MemberController
         return MemberService::welfareInfo($request);
         return MemberService::welfareInfo($request);
     }
     }
 
 
+    /**
+     * @Desc 我的粉丝列表
+     * @Author Gorden
+     * @Date 2024/9/20 10:22
+     *
+     * @param Request $request
+     * @return \support\Response
+     */
+    public function fansList(Request $request)
+    {
+        $memberId = $request->get('member_id');
+        if (!$memberId) {
+            return json_fail("参数错误");
+        }
+
+        return MemberService::fansList($request);
+    }
+
+    public function clearWelfare(Request $request)
+    {
+        $memberId = $request->post('member_id', '');
+        if (!$memberId) {
+            return json_fail("参数错误");
+        }
+
+        return MemberService::clearWelfare($request);
+    }
+
     public function balanceInfo(Request $request)
     public function balanceInfo(Request $request)
     {
     {
         $memberId = $request->get('member_id', '');
         $memberId = $request->get('member_id', '');

+ 5 - 4
app/admin/controller/member/WriteOffController.php

@@ -26,6 +26,7 @@ class WriteOffController extends Curd
         $userId = $request->get('user_id', '');
         $userId = $request->get('user_id', '');
         $premises = $request->get('premises', '');
         $premises = $request->get('premises', '');
         $date = $request->get('date', []);
         $date = $request->get('date', []);
+        $memberId = $request->get('member_id','');
 
 
         $appointmentList = Db::table('appointment')
         $appointmentList = Db::table('appointment')
             ->leftJoin('member', 'member.member_id', '=', 'appointment.join_appointment_member_id')
             ->leftJoin('member', 'member.member_id', '=', 'appointment.join_appointment_member_id')
@@ -39,12 +40,12 @@ class WriteOffController extends Curd
                 $date[0] = date('Y-m-d', strtotime($date[0])) . ' 00:00:00';
                 $date[0] = date('Y-m-d', strtotime($date[0])) . ' 00:00:00';
                 $date[1] = date('Y-m-d', strtotime($date[1])) . ' 23:59:59';
                 $date[1] = date('Y-m-d', strtotime($date[1])) . ' 23:59:59';
                 $query->whereBetween('appointment.appointment_done_datetime', $date);
                 $query->whereBetween('appointment.appointment_done_datetime', $date);
-            })
-            ->when($userId != '', function ($query) use ($userId) {
+            })->when($userId != '', function ($query) use ($userId) {
                 $query->whereJsonContains('appointment.appointment_done_json->charge->charge_user_id', $userId);
                 $query->whereJsonContains('appointment.appointment_done_json->charge->charge_user_id', $userId);
-            })
-            ->when($premises != '', function ($query) use ($premises) {
+            })->when($premises != '', function ($query) use ($premises) {
                 $query->whereJsonContains('appointment.appointment_done_json->charge->charge_premises', $premises);
                 $query->whereJsonContains('appointment.appointment_done_json->charge->charge_premises', $premises);
+            })->when(!empty($memberId),function ($query) use ($memberId){
+                $query->where('join_appointment_member_id',$memberId);
             })
             })
             ->where('appointment_status', 'DONE');
             ->where('appointment_status', 'DONE');
         $quotaList = Db::table('member_quota')
         $quotaList = Db::table('member_quota')

+ 8 - 2
app/admin/controller/order/KangyangCityController.php

@@ -78,7 +78,7 @@ class KangyangCityController extends Curd
             $goodsOrderIds = OrderSheet::whereIn('join_sheet_goods_id', $goodsIds)->pluck('join_sheet_order_id')->toArray();
             $goodsOrderIds = OrderSheet::whereIn('join_sheet_goods_id', $goodsIds)->pluck('join_sheet_order_id')->toArray();
             if (!empty($where['order_id'])) {
             if (!empty($where['order_id'])) {
                 $orderIds = array_intersect($orderIds, $goodsOrderIds);
                 $orderIds = array_intersect($orderIds, $goodsOrderIds);
-            }else{
+            } else {
                 $orderIds = $goodsOrderIds;
                 $orderIds = $goodsOrderIds;
             }
             }
         }
         }
@@ -957,10 +957,16 @@ class KangyangCityController extends Curd
                         }
                         }
                     }
                     }
                 }
                 }
-                $item['member']['level'] = '普通用户';
+                $item['member']['level'] = '普通会员';
                 if (!empty($item['member']['join_member_role_id'])) {
                 if (!empty($item['member']['join_member_role_id'])) {
                     $item['member']['level'] = MemberRole::where('member_role_id', $item['member']['join_member_role_id'])->value('member_role_name');
                     $item['member']['level'] = MemberRole::where('member_role_id', $item['member']['join_member_role_id'])->value('member_role_name');
                 }
                 }
+
+                if (!empty($item['member_info'])){
+                    if (empty($item['member_info']['member_info_headimg']) || substr($item['member_info']['member_info_headimg'],0,1) == '.'){
+                        $item['member_info']['member_info_headimg'] = "https://img.wanyuewellness.com.cn/images/avatar_default.png";
+                    }
+                }
             }
             }
             $order->sheet_amount = number_format($sheetAmount, 2);
             $order->sheet_amount = number_format($sheetAmount, 2);
 
 

+ 7 - 2
app/admin/controller/order/PayDetailController.php

@@ -333,12 +333,17 @@ class PayDetailController extends Curd
         try {
         try {
             $data = $this->insertRechargeInput($request, 'WELFARE');
             $data = $this->insertRechargeInput($request, 'WELFARE');
             $data['pay_prepayid'] = $data['join_pay_member_id'] . '-WELFARE';
             $data['pay_prepayid'] = $data['join_pay_member_id'] . '-WELFARE';
+            $memberAccount = MemberAccount::where('join_account_member_id', $data['join_pay_member_id'])
+                ->where('member_account_classify', 'WELFARE')
+                ->first();
+            if ($memberAccount->member_account_status != 'ACTIVED'){
+                throw new BusinessException('福利账户未开启');
+            }
 
 
             $this->doInsert($data);
             $this->doInsert($data);
 
 
             // 金额累加到福利账户
             // 金额累加到福利账户
-            $memberAccount = MemberAccount::where('join_account_member_id', $data['join_pay_member_id'])->where('member_account_classify', 'WELFARE')->first();
-            $memberAccount->member_account_income = $memberAccount->member_account_income + $data['pay_amount'];
+           $memberAccount->member_account_income = $memberAccount->member_account_income + $data['pay_amount'];
             $memberAccount->member_account_surplus = $memberAccount->member_account_surplus + $data['pay_amount'];
             $memberAccount->member_account_surplus = $memberAccount->member_account_surplus + $data['pay_amount'];
             $memberAccount->save();
             $memberAccount->save();
 
 

+ 49 - 0
app/admin/controller/order/RefundController.php

@@ -343,6 +343,14 @@ class RefundController extends Curd
                     $prepayid = $order->join_order_member_id . '-CASH';
                     $prepayid = $order->join_order_member_id . '-CASH';
                     $this->refundToCash($order->join_order_member_id, $amount);
                     $this->refundToCash($order->join_order_member_id, $amount);
                     $response = ['order_id' => $order->order_id, 'member_id' => $order->join_order_member_id];
                     $response = ['order_id' => $order->order_id, 'member_id' => $order->join_order_member_id];
+                } elseif (isset($payWay[1]) && $payWay[1] == 'WELFARE') {
+                    $prepayid = $order->join_order_member_id . '-WELFARE';
+                    $this->refundToWelfare($order->join_order_member_id, $amount);
+                    $response = ['order_id' => $order->order_id, 'member_id' => $order->join_order_member_id];
+                }  elseif (isset($payWay[1]) && $payWay[1] == 'VIP') {
+                    $prepayid = $order->join_order_member_id . '-VIP';
+                    $this->refundToVIP($order->join_order_member_id, $amount);
+                    $response = ['order_id' => $order->order_id, 'member_id' => $order->join_order_member_id];
                 } elseif (isset($payWay['1']) && $payWay[1] == 'CARD') {
                 } elseif (isset($payWay['1']) && $payWay[1] == 'CARD') {
                     $prepayid = $order->join_order_member_id . '-CARD';
                     $prepayid = $order->join_order_member_id . '-CARD';
                     $this->refundToCard($order->join_order_member_id, $amount);
                     $this->refundToCard($order->join_order_member_id, $amount);
@@ -395,6 +403,47 @@ class RefundController extends Curd
         $account->save();
         $account->save();
     }
     }
 
 
+    /**
+     * @Desc 退款到福利账户
+     * @Author Gorden
+     * @Date 2024/9/20 17:09
+     *
+     * @param $memberId
+     * @param $amount
+     * @return void
+     * @throws BusinessException
+     */
+    private function refundToWelfare($memberId, $amount)
+    {
+        $account = MemberAccount::where('join_account_member_id', $memberId)->where('member_account_classify', 'WELFARE')->first();
+        if (!$account) {
+            throw new BusinessException("余额账户异常");
+        }
+        $account->member_account_surplus = $account->member_account_surplus + $amount;
+        $account->save();
+    }
+
+    /**
+     * @Desc 退款到VIP账户
+     * @Author Gorden
+     * @Date 2024/9/20 17:12
+     *
+     * @param $memberId
+     * @param $amount
+     * @return void
+     * @throws BusinessException
+     */
+    private function refundToVIP($memberId, $amount)
+    {
+        $account = MemberAccount::where('join_account_member_id', $memberId)->where('member_account_classify', 'VIP')->first();
+        if (!$account) {
+            throw new BusinessException("余额账户异常");
+        }
+        $account->member_account_surplus = $account->member_account_surplus + $amount;
+        $account->save();
+    }
+
+
     /**
     /**
      * @Desc 退款到储蓄卡
      * @Desc 退款到储蓄卡
      * @Author Gorden
      * @Author Gorden

+ 8 - 2
app/admin/controller/order/WholeController.php

@@ -459,10 +459,16 @@ class WholeController extends Curd
                         }
                         }
                     }
                     }
                 }
                 }
-                $item['member']['level'] = '普通用户';
+                $item['member']['level'] = '普通会员';
                 if (!empty($item['member']['join_member_role_id'])) {
                 if (!empty($item['member']['join_member_role_id'])) {
                     $item['member']['level'] = MemberRole::where('member_role_id', $item['member']['join_member_role_id'])->value('member_role_name');
                     $item['member']['level'] = MemberRole::where('member_role_id', $item['member']['join_member_role_id'])->value('member_role_name');
                 }
                 }
+
+                if (!empty($item['member_info'])){
+                    if (empty($item['member_info']['member_info_headimg']) || substr($item['member_info']['member_info_headimg'],0,1) == '.'){
+                        $item['member_info']['member_info_headimg'] = "https://img.wanyuewellness.com.cn/images/avatar_default.png";
+                    }
+                }
             }
             }
             $order->sheet_amount = number_format($sheetAmount, 2);
             $order->sheet_amount = number_format($sheetAmount, 2);
 
 
@@ -4543,7 +4549,7 @@ class WholeController extends Curd
             if (!empty($item['member']) && $item['member']['member_mobile'] == '0000') {
             if (!empty($item['member']) && $item['member']['member_mobile'] == '0000') {
                 $memberName = '散客';
                 $memberName = '散客';
             } else {
             } else {
-                $memberName = !empty($item['cert']) ? $item['cert']['member_cert_name'] : (!empty($item['member']) ? (substr($item['member']['member_mobile'], -4) . '用户' . '-') : '');
+                $memberName = !empty($item['cert']) ? $item['cert']['member_cert_name'] : (!empty($item['member']) ? (substr($item['member']['member_mobile'], -4) . '会员' . '-') : '');
                 if (!empty($item['member'])) {
                 if (!empty($item['member'])) {
                     $memberName .= $item['member']['member_mobile'];
                     $memberName .= $item['member']['member_mobile'];
                 }
                 }

+ 19 - 0
app/admin/service/coupon/CouponDetailService.php

@@ -35,4 +35,23 @@ class CouponDetailService
             throw new BusinessException('写入优惠券失败');
             throw new BusinessException('写入优惠券失败');
         }
         }
     }
     }
+
+    public static function customSendCouponHave($params)
+    {
+        try {
+            CouponDetail::where('join_detail_coupon_id',$params['coupon_id'])
+                ->whereIn('coupon_detail_status',['INIT','PENDING'])
+                ->limit($params['chooseCouponNbr'])
+                ->update([
+                    'join_coupon_detail_member_id' => $params['member_id'],
+                    'coupon_detail_gain_datetime' => $params['coupon_detail_gain_datetime'],
+                    'coupon_detail_deadline_datetime' => $params['coupon_detail_deadline_datetime'],
+                    'coupon_detail_extend_json'=>json_encode(['gettype'=>'SEND']),
+                    'coupon_detail_status'=>'ACTIVED'
+                ]);
+        } catch (\Exception $e) {
+            throw new BusinessException('写入优惠券失败');
+        }
+    }
+
 }
 }

+ 194 - 10
app/admin/service/member/MemberService.php

@@ -2,6 +2,7 @@
 
 
 namespace app\admin\service\member;
 namespace app\admin\service\member;
 
 
+use app\common\Tree;
 use app\model\ClientPoints;
 use app\model\ClientPoints;
 use app\model\CouponDetail;
 use app\model\CouponDetail;
 use app\model\Device;
 use app\model\Device;
@@ -23,6 +24,7 @@ use app\model\SysUser;
 use support\Db;
 use support\Db;
 use support\exception\BusinessException;
 use support\exception\BusinessException;
 use support\Request;
 use support\Request;
+use support\Response;
 
 
 class MemberService
 class MemberService
 {
 {
@@ -37,6 +39,7 @@ class MemberService
         $isAuth = $request->get('is_auth', '');
         $isAuth = $request->get('is_auth', '');
         $addtime = $request->get('member_addtimes', []);
         $addtime = $request->get('member_addtimes', []);
         $type = $request->get('type', '');
         $type = $request->get('type', '');
+        $status = $request->get('member_status', '');
 
 
         $rows = Member::with([
         $rows = Member::with([
             'account' => function ($query) {
             'account' => function ($query) {
@@ -82,11 +85,13 @@ class MemberService
                 }
                 }
                 $query->whereBetween('member.member_addtimes', $addtime);
                 $query->whereBetween('member.member_addtimes', $addtime);
             })->when(!empty($nickname), function ($query) use ($nickname) {
             })->when(!empty($nickname), function ($query) use ($nickname) {
-                $query->where(function($query2) use ($nickname){
-                    $query2->where('member_info.member_info_nickname','like','%'.$nickname.'%')->orWhere('member.member_mobile','like','%'.$nickname.'%');
+                $query->where(function ($query2) use ($nickname) {
+                    $query2->where('member_info.member_info_nickname', 'like', '%' . $nickname . '%')->orWhere('member.member_mobile', 'like', '%' . $nickname . '%');
                 });
                 });
+            })->when(!empty($status), function ($query) use ($status) {
+                $query->where('member_status', $status);
             })
             })
-            ->select('member_id', 'member_is_vip', 'member_is_owner', 'member_classify', 'member_status', 'member_mobile', 'member_from', 'member_addtimes', 'member_extend_json',
+            ->select('member_id', 'member_is_vip', 'member_is_owner','member_is_partner','member_is_referrer', 'member_classify', 'member_status', 'member_mobile', 'member_from', 'member_addtimes', 'member_extend_json',
                 'member_info.member_info_nickname', 'member_info.member_info_headimg', 'member_info.member_info_referee', 'member_info.member_info_business', 'member_info.member_info_service', 'member_info.member_info_city', 'member_info.member_info_address', 'member_info.member_info_gender', 'member_info.member_info_birthday',
                 'member_info.member_info_nickname', 'member_info.member_info_headimg', 'member_info.member_info_referee', 'member_info.member_info_business', 'member_info.member_info_service', 'member_info.member_info_city', 'member_info.member_info_address', 'member_info.member_info_gender', 'member_info.member_info_birthday',
                 'member_role.member_role_id', 'member_role.member_role_name',
                 'member_role.member_role_id', 'member_role.member_role_name',
                 'member_cert.member_cert_birth', 'member_cert.member_cert_gender', 'member_cert.member_cert_name', 'member_cert.member_cert_nbr', 'member_cert.member_cert_province', 'member_cert.member_cert_addr', 'member_cert.member_cert_face', 'member_cert.member_cert_photo', 'member_cert.member_cert_nation'
                 'member_cert.member_cert_birth', 'member_cert.member_cert_gender', 'member_cert.member_cert_name', 'member_cert.member_cert_nbr', 'member_cert.member_cert_province', 'member_cert.member_cert_addr', 'member_cert.member_cert_face', 'member_cert.member_cert_photo', 'member_cert.member_cert_nation'
@@ -210,6 +215,16 @@ class MemberService
                     }
                     }
                 }
                 }
             }
             }
+            // 粉丝
+            $fans1 = Member::where('join_invite_member_id', $row['member_id'])
+                ->select('member_id')
+                ->get()
+                ->toArray();
+            $fans1Ids = array_column($fans1, 'member_id');
+            $fans2Count = Member::whereIn('join_invite_member_id', $fans1Ids)
+                ->count();
+            $row['fans_total'] = count($fans1) + $fans2Count;
+
         }
         }
 
 
         return json_success('', compact('rows', 'page', 'pageSize', 'total'));
         return json_success('', compact('rows', 'page', 'pageSize', 'total'));
@@ -267,7 +282,7 @@ class MemberService
         $exportData = [];
         $exportData = [];
         foreach ($rows as $row) {
         foreach ($rows as $row) {
             $row['info'] = [
             $row['info'] = [
-                'member_info_nickname' => !empty($row['member_info_nickname']) ? $row['member_info_nickname'] : substr($row['member_mobile'], -4, 4) . '用户',
+                'member_info_nickname' => !empty($row['member_info_nickname']) ? $row['member_info_nickname'] : substr($row['member_mobile'], -4, 4) . '会员',
                 'member_info_headimg' => !empty($row['member_info_headimg']) ? $row['member_info_headimg'] : '',
                 'member_info_headimg' => !empty($row['member_info_headimg']) ? $row['member_info_headimg'] : '',
                 'member_info_referee' => !empty($row['member_info_referee']) ? $row['member_info_referee'] : '',
                 'member_info_referee' => !empty($row['member_info_referee']) ? $row['member_info_referee'] : '',
                 'member_info_business' => !empty($row['member_info_business']) ? $row['member_info_business'] : '',
                 'member_info_business' => !empty($row['member_info_business']) ? $row['member_info_business'] : '',
@@ -322,7 +337,7 @@ class MemberService
                 'cash' => isset($account['cash']) ? $account['cash']['member_account_surplus'] + $account['cash']['member_account_added'] : 0,
                 'cash' => isset($account['cash']) ? $account['cash']['member_account_surplus'] + $account['cash']['member_account_added'] : 0,
                 'points' => isset($account['points']) ? $account['points']['member_account_surplus'] + $account['points']['member_account_added'] : 0,
                 'points' => isset($account['points']) ? $account['points']['member_account_surplus'] + $account['points']['member_account_added'] : 0,
                 'is_auth' => $row['is_auth'],
                 'is_auth' => $row['is_auth'],
-                'level' => $row['member_role_name'] ?? '普通用户',
+                'level' => $row['member_role_name'] ?? '普通会员',
                 'member_addtimes' => $row['member_addtimes'],
                 'member_addtimes' => $row['member_addtimes'],
                 'member_info_referee' => $row['info']['member_info_referee'] ?? '',
                 'member_info_referee' => $row['info']['member_info_referee'] ?? '',
                 'member_info_business' => $row['info']['member_info_business'] ?? '',
                 'member_info_business' => $row['info']['member_info_business'] ?? '',
@@ -343,7 +358,7 @@ class MemberService
         }
         }
         $member = $member->toArray();
         $member = $member->toArray();
         $member['info'] = [
         $member['info'] = [
-            'member_info_nickname' => !empty($member['info']) && !empty($member['info']['member_info_nickname']) ? $member['info']['member_info_nickname'] : substr($member['member_mobile'], -4, 4) . '用户',
+            'member_info_nickname' => !empty($member['info']) && !empty($member['info']['member_info_nickname']) ? $member['info']['member_info_nickname'] : substr($member['member_mobile'], -4, 4) . '会员',
             'member_info_headimg' => !empty($member['info']) && !empty($member['info']['member_info_headimg']) ? $member['info']['member_info_headimg'] : '',
             'member_info_headimg' => !empty($member['info']) && !empty($member['info']['member_info_headimg']) ? $member['info']['member_info_headimg'] : '',
             'member_info_referee' => !empty($member['info']) && !empty($member['info']['member_info_referee']) ? $member['info']['member_info_referee'] : '',
             'member_info_referee' => !empty($member['info']) && !empty($member['info']['member_info_referee']) ? $member['info']['member_info_referee'] : '',
             'member_info_business' => !empty($member['info']) && !empty($member['info']['member_info_business']) ? $member['info']['member_info_business'] : '',
             'member_info_business' => !empty($member['info']) && !empty($member['info']['member_info_business']) ? $member['info']['member_info_business'] : '',
@@ -659,6 +674,175 @@ class MemberService
         return json_success('', compact('rows', 'page', 'pageSize', 'total'));
         return json_success('', compact('rows', 'page', 'pageSize', 'total'));
     }
     }
 
 
+    /**
+     * @Desc 我的粉丝列表
+     * @Author Gorden
+     * @Date 2024/9/20 10:22
+     *
+     * @param Request $request
+     */
+    public static function fansList(Request $request)
+    {
+        $memberId = $request->get('member_id');
+        $name = $request->get('name', '');
+        $mobile = $request->get('mobile', '');
+        $memberIds = [];
+        $memberInviteIds = [];
+        if (!empty($name)) {
+            $memberIds = MemberCert::where('member_cert_name', 'like', '%' . $name . '%')->pluck('join_cert_member_id')->toArray();
+            $memberInviteIds = Member::whereIn('member_id', $memberIds)->pluck('join_invite_member_id')->toArray();
+        }
+        if (!empty($mobile)) {
+            $members = Member::where('member_mobile', 'like', '%' . $mobile . '%')
+                ->select('member_id', 'join_invite_member_id')
+                ->get()
+                ->toArray();
+            $memberIds2 = array_column($members, 'member_id');
+            $memberInviteIds2 = array_column($members, 'join_invite_member_id');
+            $memberIds = array_merge($memberIds, $memberIds2);
+            $memberInviteIds = array_merge($memberInviteIds, $memberInviteIds2);
+        }
+
+        $fans1 = Member::with([
+            'info' => function ($query) {
+                $query->select('join_info_member_id', 'member_info_nickname', 'member_info_headimg');
+            },
+            'cert' => function ($query) {
+                $query->select('join_cert_member_id', 'member_cert_name');
+            },
+            'role' => function ($query) {
+                $query->select('member_role_id', 'member_role_name');
+            }
+        ])->where('join_invite_member_id', $memberId)
+            ->when(!empty($memberIds), function ($query) use ($memberIds, $memberInviteIds) {
+                $allSub = array_merge($memberIds, $memberInviteIds);
+                $query->whereIn('member_id', $allSub);
+            })
+            ->select('member_id', 'join_member_role_id', 'member_id as id', 'join_invite_member_id as pid', 'member_partner_json', 'member_mobile', 'member_addtimes', 'member_is_owner', 'member_is_vip', 'member_is_partner', 'member_is_referrer')
+            ->get()
+            ->toArray();
+        $fans1Ids = array_column($fans1, 'id');
+        $fans2 = Member::with([
+            'info' => function ($query) {
+                $query->select('join_info_member_id', 'member_info_nickname', 'member_info_headimg');
+            },
+            'cert' => function ($query) {
+                $query->select('join_cert_member_id', 'member_cert_name');
+            },
+            'role' => function ($query) {
+                $query->select('member_role_id', 'member_role_name');
+            }
+        ])->whereIn('join_invite_member_id', $fans1Ids)
+            ->when(!empty($memberIds), function ($query) use ($memberIds) {
+                $query->whereIn('member_id', $memberIds);
+            })
+            ->select('member_id', 'join_member_role_id', 'member_id as id', 'join_invite_member_id as pid', 'member_partner_json', 'member_mobile', 'member_addtimes', 'member_is_owner', 'member_is_vip', 'member_is_partner', 'member_is_referrer')
+            ->get()
+            ->toArray();
+
+        $fans = array_merge($fans1, $fans2);
+        foreach ($fans as &$fan) {
+            $memberMobile = $fan['member_mobile'] ?? '';
+//            $memberNickname = $fan['info'] && $fan['info']['member_info_nickname'] ? $fan['info']['member_info_nickname'] : '';
+            $memberCertName = $fan['cert'] && $fan['cert']['member_cert_name'] ? $fan['cert']['member_cert_name'] : '';
+            $fan['member_name'] = '';
+            if (!empty($memberCertName) && !empty($memberMobile)) {
+                $fan['member_name'] = $memberCertName . '-' . $memberMobile;
+            } elseif (!empty($memberCertName)) {
+                $fan['member_name'] = $memberCertName;
+            } elseif (!empty($memberMobile)) {
+                $fan['member_name'] = $memberMobile;
+            }
+            if (!empty($fan['info']) && substr($fan['info']['member_info_headimg'], 0, 4) == 'http') {
+                $fan['member_info_headimg'] = $fan['info']['member_info_headimg'];
+            } else {
+                $fan['member_info_headimg'] = 'https://img.wanyuewellness.com.cn/images/avatar_default.png';
+            }
+            // 等级名称
+            $fan['role_name'] = $fan['role'] && $fan['role']['member_role_name'] ? $fan['role']['member_role_name'] : '';
+
+            unset($fan['info'], $fan['cert'], $fan['role']);
+        }
+
+        $tree = new Tree($fans);
+        return json_success('success', $tree->getTree());
+    }
+
+
+    /**
+     * 格式化树
+     * @param $items
+     * @return Response
+     */
+    protected static function formatTree($items): Response
+    {
+        $format_items = [];
+        foreach ($items as $item) {
+            $format_items[] = [
+                'name' => $item->title ?? $item->name ?? $item->id,
+                'value' => (string)$item->id,
+                'id' => $item->id,
+                'pid' => $item->pid,
+            ];
+        }
+        $tree = new Tree($format_items);
+        return json_success('success', $tree->getTree());
+    }
+
+    public static function clearWelfare(Request $request)
+    {
+        $memberId = $request->post('member_id');
+        $payTime = $request->post('pay_paytimes', date('Y-m-d H:i:s'));
+        $payTime = date('Y-m-d H:i:s', strtotime($payTime));
+        $payRemark = $request->post('pay_remark', '');
+        $clearPwd = $request->post('clear_password');
+        if (!$clearPwd || $clearPwd != '123456') {
+            return json_fail('清零密码错误');
+        }
+
+        Db::beginTransaction();
+        try {
+            $account = MemberAccount::where('join_account_member_id', $memberId)
+                ->where('member_account_classify', 'WELFARE')
+                ->where('member_account_status', 'ACTIVED')
+                ->first();
+            if (!$account) {
+                throw new BusinessException("账户异常");
+            }
+            if ($account->member_account_surplus <= 0) {
+                throw new BusinessException("账户余额为0,无需清零");
+            }
+            // 创建清除记录
+            PayDetail::insert([
+                'join_pay_member_id' => $memberId,
+                'pay_status' => 'SUCCESS',
+                'pay_category' => 'CLEAR',
+                'pay_amount' => $account->member_account_surplus,
+                'pay_paytimes' => $payTime,
+                'pay_prepayid' => $memberId . '-WELFARE',
+                'pay_remark' => $payRemark,
+                'pay_addtimes' => time()
+            ]);
+
+            // 账户归零
+            $account->member_account_expend = $account->member_account_expend + $account->member_account_surplus;
+            $account->member_account_surplus = 0;
+            $account->save();
+
+            Db::commit();
+
+            return json_success('success');
+        } catch (BusinessException $e) {
+            Db::rollBack();
+            return json_fail($e->getMessage());
+        } catch (\Exception $e) {
+            dump($e->getMessage());
+            Db::rollBack();
+
+            return json_fail('清零失败');
+        }
+    }
+
     public static function balanceInfo(Request $request)
     public static function balanceInfo(Request $request)
     {
     {
         $memberId = $request->get('member_id', '');
         $memberId = $request->get('member_id', '');
@@ -711,12 +895,12 @@ class MemberService
             if (mb_substr($item['goods_category'], 0, 7) == '自定义金额充值') {
             if (mb_substr($item['goods_category'], 0, 7) == '自定义金额充值') {
                 $item['goods_category'] = '自定义金额充值';
                 $item['goods_category'] = '自定义金额充值';
             }
             }
-            if (in_array($item['pay_category'], ['RECHARGE', 'REFUND', 'GIVE','PARTNER'])) {
+            if (in_array($item['pay_category'], ['RECHARGE', 'REFUND', 'GIVE', 'PARTNER'])) {
                 $item['balance_type'] = 'add';
                 $item['balance_type'] = 'add';
             } else {
             } else {
                 $item['balance_type'] = 'cut';
                 $item['balance_type'] = 'cut';
             }
             }
-            if ($key == 0 && in_array($item['pay_category'], ['RECHARGE', 'REFUND', 'GIVE','PARTNER'])) {
+            if ($key == 0 && in_array($item['pay_category'], ['RECHARGE', 'REFUND', 'GIVE', 'PARTNER'])) {
                 if (!empty($item['pay_extend_json'])) {
                 if (!empty($item['pay_extend_json'])) {
                     $extendJson = json_decode($item['pay_extend_json'], true);
                     $extendJson = json_decode($item['pay_extend_json'], true);
                     if (!isset($extendJson['added_amount'])) {
                     if (!isset($extendJson['added_amount'])) {
@@ -741,14 +925,14 @@ class MemberService
 
 
                 $item['balance'] = number_format($balance, 2, '.', '');
                 $item['balance'] = number_format($balance, 2, '.', '');
                 $balance = $balance - $item['pay_amount'];
                 $balance = $balance - $item['pay_amount'];
-                if ($item['pay_category'] != 'GIVE'){
+                if ($item['pay_category'] != 'GIVE') {
                     $data[] = $item;
                     $data[] = $item;
                 }
                 }
 
 
                 continue;
                 continue;
             }
             }
 
 
-            if (in_array($item['pay_category'], ['RECHARGE', 'REFUND', 'GIVE','PARTNER'])) {
+            if (in_array($item['pay_category'], ['RECHARGE', 'REFUND', 'GIVE', 'PARTNER'])) {
                 if (!empty($item['pay_extend_json'])) {
                 if (!empty($item['pay_extend_json'])) {
                     $extendJson = json_decode($item['pay_extend_json'], true);
                     $extendJson = json_decode($item['pay_extend_json'], true);
                     if (isset($extendJson['added_amount']) && floatval($extendJson['added_amount']) > 0) {
                     if (isset($extendJson['added_amount']) && floatval($extendJson['added_amount']) > 0) {

+ 3 - 1
app/admin/service/order/AppointmentService.php

@@ -36,6 +36,7 @@ class AppointmentService
         $premisesName = $request->get('premises', '');
         $premisesName = $request->get('premises', '');
         $appointmentMode = $request->get('appointment_mode', '');
         $appointmentMode = $request->get('appointment_mode', '');
         $type = $request->get('type', '');
         $type = $request->get('type', '');
+        $memberId = $request->get('join_appointment_member_id','');
 
 
         $rows = Db::table('appointment')
         $rows = Db::table('appointment')
             ->leftJoin('member', 'member.member_id', '=', 'appointment.join_appointment_member_id')
             ->leftJoin('member', 'member.member_id', '=', 'appointment.join_appointment_member_id')
@@ -64,11 +65,12 @@ class AppointmentService
                 } else {
                 } else {
                     $query->where('appointment_mode', $appointmentMode);
                     $query->where('appointment_mode', $appointmentMode);
                 }
                 }
+            })->when(!empty($memberId),function ($query) use ($memberId){
+                $query->where('join_appointment_member_id',$memberId);
             })->when(!empty($type), function ($query) use ($type) {
             })->when(!empty($type), function ($query) use ($type) {
                 if ($type == 'todayDONE') {
                 if ($type == 'todayDONE') {
                     $query->where('appointment_status', 'DONE');
                     $query->where('appointment_status', 'DONE');
                     $query->whereRaw('LEFT(appointment_done_datetime,10)=?', [date('Y-m-d')]);
                     $query->whereRaw('LEFT(appointment_done_datetime,10)=?', [date('Y-m-d')]);
-//                    $query->whereBetween('appointment_addtimes',[strtotime(date('Y-m-d').' 00:00:00'),strtotime(date('Y-m-d').' 23:59:59')]);
                 } elseif ($type == 'todayAppointment') {
                 } elseif ($type == 'todayAppointment') {
                     $query->where('appointment_datetime', date('Y-m-d'));
                     $query->where('appointment_datetime', date('Y-m-d'));
                 }
                 }

+ 1 - 2
app/admin/service/statistics/OrderService.php

@@ -39,8 +39,7 @@ class OrderService
             ->where('order_status_payment','SUCCESS')
             ->where('order_status_payment','SUCCESS')
             ->sum('order_amount_pay');
             ->sum('order_amount_pay');
         // 今日退单
         // 今日退单
-        $data['todayRefund'] = OrderReturn::where('order_return_addtimes', '>', $todayTimeUnix)
-            ->count();
+        $data['todayRefund'] = $refundAmount;
 
 
 
 
         // 柱状图
         // 柱状图

+ 8 - 6
app/model/OrderSheet.php

@@ -37,7 +37,7 @@ class OrderSheet extends Model
     public function memberInfo()
     public function memberInfo()
     {
     {
         return $this->hasOne(MemberInfo::class, 'join_info_member_id', 'join_sheet_member_id')
         return $this->hasOne(MemberInfo::class, 'join_info_member_id', 'join_sheet_member_id')
-            ->select('join_info_member_id', 'member_info_nickname');
+            ->select('join_info_member_id', 'member_info_nickname', 'member_info_headimg');
     }
     }
 
 
     public function cert()
     public function cert()
@@ -100,16 +100,18 @@ class OrderSheet extends Model
             ->select('join_running_goods_id', 'goods_running_storage', 'goods_running_sale');
             ->select('join_running_goods_id', 'goods_running_storage', 'goods_running_sale');
     }
     }
 
 
-    public function skus(){
-        return $this->hasMany(GoodsSku::class,'join_sku_goods_id','join_sheet_goods_id');
+    public function skus()
+    {
+        return $this->hasMany(GoodsSku::class, 'join_sku_goods_id', 'join_sheet_goods_id');
     }
     }
 
 
     public function sku()
     public function sku()
     {
     {
         return $this->hasOne(GoodsSku::class, 'goods_sku_id', 'join_sheet_goods_sku_id');
         return $this->hasOne(GoodsSku::class, 'goods_sku_id', 'join_sheet_goods_sku_id');
     }
     }
-    
-    public function benefit(){
-        return $this->hasMany(MemberBenefit::class,'join_benefit_order_id','join_sheet_order_id');
+
+    public function benefit()
+    {
+        return $this->hasMany(MemberBenefit::class, 'join_benefit_order_id', 'join_sheet_order_id');
     }
     }
 }
 }

+ 3 - 0
route/admin.php

@@ -685,6 +685,7 @@ Route::group('/admin', function () {
             Route::get('/selectMemberAllQuota', [\app\admin\controller\member\MemberController::class, 'selectMemberAllQuota']);
             Route::get('/selectMemberAllQuota', [\app\admin\controller\member\MemberController::class, 'selectMemberAllQuota']);
             Route::get('/selectMemberAllQuotaByAppointment', [\app\admin\controller\member\MemberController::class, 'selectMemberAllQuotaByAppointment']);
             Route::get('/selectMemberAllQuotaByAppointment', [\app\admin\controller\member\MemberController::class, 'selectMemberAllQuotaByAppointment']);
             Route::get('/welfareInfo', [\app\admin\controller\member\MemberController::class, 'welfareInfo']);
             Route::get('/welfareInfo', [\app\admin\controller\member\MemberController::class, 'welfareInfo']);
+            Route::post('/clearWelfare', [\app\admin\controller\member\MemberController::class, 'clearWelfare']);
             Route::get('/vipInfo', [\app\admin\controller\member\MemberController::class, 'vipInfo']);
             Route::get('/vipInfo', [\app\admin\controller\member\MemberController::class, 'vipInfo']);
             Route::get('/coupon', [\app\admin\controller\member\MemberController::class, 'coupon']);
             Route::get('/coupon', [\app\admin\controller\member\MemberController::class, 'coupon']);
             Route::get('/couponCount', [\app\admin\controller\member\MemberController::class, 'couponCount']);
             Route::get('/couponCount', [\app\admin\controller\member\MemberController::class, 'couponCount']);
@@ -696,6 +697,7 @@ Route::group('/admin', function () {
             Route::post('/add', [\app\admin\controller\member\MemberController::class, 'add']);
             Route::post('/add', [\app\admin\controller\member\MemberController::class, 'add']);
             Route::post('/update', [\app\admin\controller\member\MemberController::class, 'update']);
             Route::post('/update', [\app\admin\controller\member\MemberController::class, 'update']);
             Route::get('/exportMember', [\app\admin\controller\member\MemberController::class, 'exportMember']);
             Route::get('/exportMember', [\app\admin\controller\member\MemberController::class, 'exportMember']);
+            Route::get('/fansList', [\app\admin\controller\member\MemberController::class, 'fansList']);
         })->middleware([
         })->middleware([
             \app\middleware\AdminAuthCheck::class
             \app\middleware\AdminAuthCheck::class
         ]);
         ]);
@@ -879,6 +881,7 @@ Route::group('/admin', function () {
             Route::post('/customSend', [\app\admin\controller\coupon\CouponController::class, 'customSend']);
             Route::post('/customSend', [\app\admin\controller\coupon\CouponController::class, 'customSend']);
             Route::post('/update', [\app\admin\controller\coupon\CouponController::class, 'update']);
             Route::post('/update', [\app\admin\controller\coupon\CouponController::class, 'update']);
             Route::delete('/delete', [\app\admin\controller\coupon\CouponController::class, 'delete']);
             Route::delete('/delete', [\app\admin\controller\coupon\CouponController::class, 'delete']);
+            Route::post('/disable', [\app\admin\controller\coupon\CouponController::class, 'disableCoupon']);
         })->middleware([
         })->middleware([
             \app\middleware\AdminAuthCheck::class
             \app\middleware\AdminAuthCheck::class
         ]);
         ]);