Browse Source

卡分配

gorden 19 hours ago
parent
commit
0caa1f003b

+ 5 - 0
app/admin/controller/coupon/CardController.php

@@ -236,6 +236,9 @@ class CardController extends Curd
         if ($model->join_card_dept_id != $data['join_card_dept_id'] && empty($model->join_card_member_id)) {
             $data['card_assign_datetime'] = date('Y-m-d H:i:s');
         }
+        if (!empty($data['join_card_dept_id']) && $model->card_status == 'INIT'){
+            $data['card_status'] = 'WAITING';
+        }
 
         _syslog('储值卡', '编辑', $data, $request->all());
 
@@ -362,11 +365,13 @@ class CardController extends Curd
             if ($allocation == 'CARDID' && !empty($params['card_id'])) {
                 Card::whereIn('card_id', $params['card_id'])->where('join_card_dept_id', 0)->update([
                     'join_card_dept_id' => $params['join_card_dept_id'],
+                    'card_status'=>'WAITING',
                     'card_assign_datetime' => date('Y-m-d H:i:s')
                 ]);
             } elseif ($allocation == 'ISSUE' && !empty($params['card_issue_id'])) {
                 Card::where('join_card_issue_id', $params['card_issue_id'])->where('join_card_dept_id', 0)->update([
                     'join_card_dept_id' => $params['join_card_dept_id'],
+                    'card_status'=>'WAITING',
                     'card_assign_datetime' => date('Y-m-d H:i:s')
                 ]);
             }

+ 1 - 1
app/admin/controller/order/RechargeController.php

@@ -876,7 +876,7 @@ class RechargeController extends Curd
                 ->whereJsonContains('join_pay_object_json->order_id', $orderId)
                 ->where('pay_category', '<>', 'REFUND')
                 ->where('pay_status', 'SUCCESS')
-                ->select('pay_id', 'pay_category', 'pay_prepayid', 'pay_paytimes', 'pay_status', 'pay_amount', 'pay_extend_json')
+                ->select('pay_id', 'pay_category', 'pay_prepayid', 'pay_paytimes', 'pay_status', 'pay_amount', 'pay_extend_json','pay_remark')
                 ->get();
             if (count($payDetails) > 1) {
                 $order->pay_category = 'CONSTITUTE';