Browse Source

会员录入添加支付方式

shensong 5 years ago
parent
commit
9603b67caa

+ 12 - 2
app/Http/Controllers/Admin/CustomerDepositController.php

@@ -379,7 +379,7 @@ class CustomerDepositController extends Controller
379 379
             if($name) $query->where('name', 'like', '%'. $name. '%');
380 380
             if($admin_id) $query->where('admin_id', $admin_id);
381 381
             if( !empty($saler_ids) ) $query->whereIn('admin_id', $saler_ids);
382
-        })->count();
382
+        })->where('is_del',0)->count();
383 383
         if ($count > 1) {
384 384
             // 总页数
385 385
             $pages = ceil($count/$pageSize);
@@ -392,7 +392,7 @@ class CustomerDepositController extends Controller
392 392
             if($name) $query->where('name', 'like', '%'. $name. '%');
393 393
             if($admin_id) $query->where('admin_id', $admin_id);
394 394
             if( !empty($saler_ids) ) $query->whereIn('admin_id', $saler_ids);
395
-        })->orderBy('id','desc')->offset($offset)->limit($pageSize)->get();
395
+        })->where('is_del',0)->orderBy('id','desc')->offset($offset)->limit($pageSize)->get();
396 396
         $result = json_decode(json_encode($result),true);
397 397
 
398 398
         $result = array_map(function($value){
@@ -412,6 +412,14 @@ class CustomerDepositController extends Controller
412 412
             $admin = Admin::find($value['admin_id']);
413 413
             $item['admin_name'] = $admin->realname;
414 414
             $item['phone'] = is_numeric($item['phone']) ? substr_replace($item['phone'], '****', 3, 4) : $item['phone'];
415
+
416
+            if($item['payment_type'] == 1){
417
+                $item['payment'] = '微信支付';
418
+            } else if($item['payment_type'] == 3){
419
+                $item['payment'] = '个体户支付';
420
+            } else {
421
+                $item['payment'] = '';
422
+            }
415 423
             return $item;
416 424
         },$result);
417 425
 
@@ -486,6 +494,7 @@ class CustomerDepositController extends Controller
486 494
         $customerVip->vip_end_time = date('Y-m-d H:i:s',strtotime('+1 year'));
487 495
         $customerVip->birthday = date('Y',time()).'-'.$request->input('birthday');
488 496
         $customerVip->price = $request->input('price');
497
+        $customerVip->payment_type = $request->input('payment_type',1);
489 498
         $customerVip->is_del = 0;
490 499
 
491 500
         if($customerVip->save()) {
@@ -540,6 +549,7 @@ class CustomerDepositController extends Controller
540 549
         $customerVip->birthday = date('Y',time()).'-'.$request->input('birthday');
541 550
         $customerVip->admin_id = $request->input('admin_id');
542 551
         $customerVip->price = $request->input('price');
552
+        $customerVip->payment_type = $request->input('payment_type',1);
543 553
         if($customerVip->save()){
544 554
             return redirect('/admin/customer/vipList')->with('info', '编辑成功');
545 555
         } else {

+ 9 - 0
resources/views/customer/vipCustomerCreate.blade.php

@@ -43,6 +43,15 @@
43 43
                 </div>
44 44
             </div>
45 45
             <div class="row cl">
46
+                <label for="" class="form-label col-xs-4 col-sm-2">充值方式:</label>
47
+                <div class="formControls col-xs-6 col-sm-6">
48
+                    <select style="text-align:center" id='' class="select-box" name="payment_type">
49
+                            <option value="1" @if(old('payment_type')==1) selected @endif class="select-option">微信支付</option>
50
+                            <option value="3" @if(old('payment_type')==3) selected @endif class="select-option">个体户支付</option>
51
+                    </select>
52
+                </div>
53
+            </div>
54
+            <div class="row cl">
46 55
                 <label for="" class="form-label col-xs-4 col-sm-2">选择销售:</label>
47 56
                 <div class="formControls col-xs-6 col-sm-6">
48 57
                     <select style="text-align:center" id='admin_id' class="select-box" name="admin_id">

+ 9 - 0
resources/views/customer/vipCustomerEdit.blade.php

@@ -52,6 +52,15 @@
52 52
                 </div>
53 53
             </div>
54 54
             <div class="row cl">
55
+                <label for="" class="form-label col-xs-4 col-sm-2">充值方式:</label>
56
+                <div class="formControls col-xs-6 col-sm-6">
57
+                    <select style="text-align:center" id='' class="select-box" name="payment_type">
58
+                        <option value="1" @if($info['payment_type']==1) selected @endif class="select-option">微信支付</option>
59
+                        <option value="3" @if($info['payment_type']==3) selected @endif class="select-option">个体户支付</option>
60
+                    </select>
61
+                </div>
62
+            </div>
63
+            <div class="row cl">
55 64
                 <label for="" class="form-label col-xs-4 col-sm-2">选择销售:</label>
56 65
                 <div class="formControls col-xs-6 col-sm-6">
57 66
                     <select style="text-align:center" id='admin_id' class="select-box" name="admin_id">

+ 2 - 0
resources/views/customer/vipCustomerList.blade.php

@@ -41,6 +41,7 @@
41 41
                 <th width="10%">生日</th>
42 42
                 <th width="10%">销售</th>
43 43
                 <th width="10%">金额</th>
44
+                <th width="10%">充值方式</th>
44 45
                 {{--<th width="10%">状态</th>--}}
45 46
                 <th width="10%">操作</th>
46 47
             </tr>
@@ -55,6 +56,7 @@
55 56
                 <td class="text-c">{{date("m-d",strtotime($a['birthday']))}}</td>
56 57
                 <td class="text-c">{{$a['admin_name']}}</td>
57 58
                 <td class="text-c">{{$a['price']}}</td>
59
+                <td class="text-c">{{$a['payment']}}</td>
58 60
                 {{--<td class="text-c">{{$a['is_del'] == 0 ? '启用' : '禁用'}}</td>--}}
59 61
                 <td class="f-14 product-brand-manage">
60 62
                     <a style="text-decoration:none" onClick='user_edit("{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>