Browse Source

会员管理修改

shensong 5 years ago
parent
commit
2897096a62

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

@@ -464,7 +464,7 @@ class CustomerDepositController extends Controller
464 464
         $customerVip->discount = 95;
465 465
         $customerVip->create_time = date('Y-m-d H:i:s',time());
466 466
         $customerVip->vip_end_time = date('Y-m-d H:i:s',strtotime('+1 year'));
467
-        $customerVip->birthday = $request->input('birthday');
467
+        $customerVip->birthday = date('Y',time()).$request->input('birthday');
468 468
         $customerVip->is_del = 0;
469 469
 
470 470
         if($customerVip->save()) {
@@ -516,7 +516,7 @@ class CustomerDepositController extends Controller
516 516
         //修改vip用户信息
517 517
         $customerVip = CustomerVip::findOrFail($id);
518 518
         $customerVip->name = $request->input('name');
519
-        $customerVip->birthday = $request->input('birthday');
519
+        $customerVip->birthday = date('Y',time()).$request->input('birthday');
520 520
         $customerVip->admin_id = $request->input('admin_id');
521 521
         if($customerVip->save()){
522 522
             return redirect('/admin/customer/vipList')->with('info', '编辑成功');
@@ -701,4 +701,54 @@ class CustomerDepositController extends Controller
701 701
         }
702 702
     }
703 703
 
704
+    /**
705
+     * 查询会员信息页面
706
+     * @param Request $request
707
+     */
708
+    public function queryVipView(Request $request) {
709
+        return view('customer/customerInformationQuery');
710
+    }
711
+
712
+    /**
713
+     * 查询会员信息操作
714
+     * @param Request $request
715
+     */
716
+    public function queryVipInformation(Request $request) {
717
+        $phone = $request->input('phone');
718
+
719
+        #查询数据
720
+        $customer = CustomerVip::where('phone',$phone)->first();
721
+        if(!$customer){
722
+            //不是会员
723
+            $couponsList = null;
724
+            $giftList = null;
725
+        } else {
726
+            $couponsList = CustomerCoupons::where('phone',$phone)->get();
727
+            $giftList = CustomerGiftReceives::where('phone',$phone)->where('is_del',0)->get();
728
+        }
729
+
730
+        #处理数据
731
+        if($couponsList){
732
+            $coupons = array();
733
+            foreach($couponsList as $value) {
734
+                if($value['is_use'] == 1) {
735
+                    $coupons['use']++;
736
+                } else {
737
+                    $coupons['nouse']++;
738
+                }
739
+            }
740
+        }
741
+
742
+        if($giftList){
743
+            $gifts = array();
744
+            foreach($giftList as $value) {
745
+                if($value['gift_type'] == 1){
746
+
747
+                } else if($value['gift_type'] == 0){
748
+
749
+                }
750
+            }
751
+        }
752
+    }
753
+
704 754
 }

+ 1 - 1
resources/views/customer/vipCustomerCreate.blade.php

@@ -30,7 +30,7 @@
30 30
                 <label class="form-label col-xs-4 col-sm-2">
31 31
                     生日:</label>
32 32
                 <div class="formControls col-xs-6 col-sm-6">
33
-                    <input type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" autocomplete="off" class="input-text Wdate" name="birthday" value="{{old('birthday')}}">
33
+                    <input type="text" onfocus="WdatePicker({dateFmt:'MM-dd'})" autocomplete="off" class="input-text Wdate" name="birthday" value="{{old('birthday')}}">
34 34
                     <br>
35 35
                 </div>
36 36
             </div>

+ 1 - 1
resources/views/customer/vipCustomerEdit.blade.php

@@ -41,7 +41,7 @@
41 41
                     <label class="form-label col-xs-4 col-sm-2">
42 42
                         生日:</label>
43 43
                     <div class="formControls col-xs-6 col-sm-6">
44
-                        <input type="text" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd' })" autocomplete="off" class="input-text Wdate" name="birthday" value="{{$info['birthday']}}">
44
+                        <input type="text" onfocus="WdatePicker({ dateFmt:'MM-dd' })" autocomplete="off" class="input-text Wdate" name="birthday" value="{{date("m-d",strtotime($info['birthday']))}}">
45 45
                     </div>
46 46
                 </div>
47 47
             <div class="row cl">

+ 1 - 1
resources/views/customer/vipCustomerList.blade.php

@@ -50,7 +50,7 @@
50 50
                 <td class="text-c">{{$a['name']}}</td>
51 51
                 <td class="text-c">{{$a['phone']}}</td>
52 52
                 <td class="text-c">{{$a['vip_end_time']}}</td>
53
-                <td class="text-c">{{$a['birthday']}}</td>
53
+                <td class="text-c">{{date("m-d",strtotime($a['birthday']))}}</td>
54 54
                 <td class="text-c">{{$a['is_del'] == 0 ? '启用' : '禁用'}}</td>
55 55
                 <td class="f-14 product-brand-manage">
56 56
                     <a style="text-decoration:none" onClick='user_edit("{{$a['id']}}")' href="javascript:;" title="编辑"><span class="btn btn-primary radius">编辑</span></a>