瀏覽代碼

会员部分

shensong 5 年之前
父節點
當前提交
5f736b72a1

+ 1 - 0
app/CustomerCoupons.php

@@ -22,4 +22,5 @@ class CustomerCoupons extends Model
22 22
         $log = json_decode(json_encode($log),true);
23 23
         return $log;
24 24
     }
25
+
25 26
 }

+ 60 - 1
app/CustomerGiftReceives.php

@@ -18,8 +18,67 @@ class CustomerGiftReceives extends Model
18 18
 
19 19
     public static function getCustomerReceivesLog($phone,$type) {
20 20
         $self = new self();
21
-        $log = $self->where('phone',$phone)->where('gift_type',$type)->get();
21
+        $log = $self->where('phone',$phone)->where('gift_type',$type)->where('is_del',0)->get();
22 22
         $log = json_decode(json_encode($log),true);
23 23
         return $log;
24 24
     }
25
+
26
+    /**
27
+     * 获取会员用户每月礼包剩余领取次数
28
+     * @param $phone
29
+     */
30
+    public static function getCustomerResidualTimes($phone,$endTime) {
31
+        $self = new self();
32
+        $times = 0;
33
+        #判断本月有没有领取过
34
+        $info = $self->where('phone',$phone)->where('gift_type',0)->where('dtime','>=',date('Y-m-01',time()))->where('is_del',0)->first();
35
+        if(!$info){
36
+            $times++;
37
+        }
38
+        #判断现在距离会员结束还有几个月,最后一个月不算
39
+        $start = new \DateTime(date('Y-m-d',time()));
40
+        $end =  new \DateTime($endTime);
41
+        $diff = $start->diff($end);
42
+        $diff_month = $diff->format('%y')*12+$diff->format('%m');
43
+        $times += $diff_month;
44
+        return $times;
45
+    }
46
+
47
+    /**
48
+     * 判断用户是否能够领取礼包
49
+     * @param $phone
50
+     * @param $type
51
+     * @return bool
52
+     */
53
+    public static function judgeWhetherTheUserReceivesTheGiftBag($phone,$type){
54
+        $self = new self();
55
+        $mtime = date('Y-m-01');
56
+        if($type == 1){
57
+            $num = CustomerGiftReceives::getCustomerResidualTimes($phone,$customerInfo->vip_end_time);
58
+            $if_m_gift = DB::table('customer_gift_receives')->where('phone', $phone)->where('is_del',0)->where('gift_type', 0)->where('dtime', '>=', $mtime)->first();
59
+            if(empty($if_m_gift) && ($num >0)){
60
+                return true;
61
+            } else {
62
+                return false;
63
+            }
64
+        } else {
65
+            #判断本月有没有领取过
66
+            $customerInfo = CustomerVip::getCustomerInformation($phone);
67
+            //判断生日礼
68
+            $birth_stime = date('m-01', strtotime($customerInfo->birthday));
69
+            $birth_etime = date('m-t', strtotime($customerInfo->birthday));
70
+            $today = date('m-d');
71
+
72
+            if($today>=$birth_stime && $today<=$birth_etime){
73
+                //生日期内,判断是否已领
74
+                $if_b_gift = $self::where('phone', $phone)->where('is_del',0)->where('gift_type', 1)->where('dtime', '>=', $mtime)->first();
75
+                if(empty($if_b_gift)){
76
+                    return true;
77
+                } else {
78
+                    return false;
79
+                }
80
+            }
81
+            return false;
82
+        }
83
+    }
25 84
 }

+ 19 - 1
app/CustomerVip.php

@@ -16,9 +16,27 @@ class CustomerVip extends Model
16 16
     public $timestamps = false;
17 17
     protected $table = 'customer_vip';
18 18
 
19
-    public static function getCustomerInformation($phone) {
19
+    /**
20
+     * 获取会员信息
21
+     * @param $phone
22
+     * @return mixed
23
+     */
24
+    public static function getCustomerInformation($phone){
20 25
         $self = new self();
21 26
         $info = $self->where('phone',$phone)->where('is_del',0)->first();
22 27
         return $info;
23 28
     }
29
+
30
+    /**
31
+     * 判断用户是否为会员
32
+     * @param $phone
33
+     * @return bool
34
+     */
35
+    public static function judgeWhetherTheUserIsAMember($phone){
36
+        $info = CustomerVip::getCustomerInformation($phone);
37
+        if(!$info || (strtotime($info->vip_end_time) < time())){
38
+            return false;
39
+        }
40
+        return true;
41
+    }
24 42
 }

+ 2 - 0
app/Error.php

@@ -21,6 +21,8 @@ class Error
21 21
         2001 =>'未查询到有效数据',
22 22
         2002 =>'密码错误',
23 23
         2003 =>'充值卡余额不足',
24
+        2014 =>'该用户还不是会员',
25
+        2015 =>'不能领取当月礼包',
24 26
     ];
25 27
     /**
26 28
      * 返回错误码

+ 102 - 11
app/Http/Controllers/Admin/CustomerDepositController.php

@@ -14,6 +14,7 @@ use App\Goods;
14 14
 use App\GoodsSkus;
15 15
 use App\Http\Controllers\Controller;
16 16
 use App\Admin;
17
+use App\OrderGoodsSkus;
17 18
 use function GuzzleHttp\Psr7\str;
18 19
 use Illuminate\Http\Request;
19 20
 use App\CustomerInfo;
@@ -397,20 +398,28 @@ class CustomerDepositController extends Controller
397 398
 
398 399
         $result = array_map(function($value){
399 400
             $item = $value;
401
+            $currentDate = date('Y-m-d',time());
402
+
403
+            //生日套餐
400 404
             $birthdayGift = CustomerGiftReceives::getCustomerReceivesLog($value['phone'],1);
401 405
             if($birthdayGift){
402 406
                 $item['birthday_gift'] = $birthdayGift[0]['dtime'].' 领取';
403 407
             } else {
404 408
                 $item['birthday_gift'] = '未使用';
405 409
             }
406
-            $monthGift = CustomerGiftReceives::getCustomerReceivesLog($value['phone'],0);
407
-            $monthGiftNum = count($monthGift);
408
-            $item['month_gift'] = '剩余'.(12-$monthGiftNum).'次';
409 410
 
410
-            $coupons = CustomerCoupons::where('phone',$value['phone'])->where('is_use',0)->count();
411
+            //每月礼包
412
+            $num = CustomerGiftReceives::getCustomerResidualTimes($value['phone'],$value['vip_end_time']);
413
+            $item['month_gift'] = '剩余'.$num.'次';
414
+
415
+            //代金券
416
+            $coupons = CustomerCoupons::where('phone',$value['phone'])->where('is_use',0)->where('end_time','>=',$currentDate)->count();
411 417
             $item['coupon'] = '剩余'.$coupons.'张';
412 418
             $admin = Admin::find($value['admin_id']);
419
+
420
+            //销售人员
413 421
             $item['admin_name'] = $admin->realname;
422
+
414 423
             return $item;
415 424
         },$result);
416 425
 
@@ -726,10 +735,51 @@ class CustomerDepositController extends Controller
726 735
      */
727 736
     public function monthGiftLog(Request $request) {
728 737
         $phone = $request->input('phone');
729
-        echo "month_gift_log";die;
738
+
739
+        #查询会员领取情况以及基本信息
730 740
         $monthGiftLog = CustomerGiftReceives::getCustomerReceivesLog($phone,0);
741
+        $customerInformation = CustomerVip::getCustomerInformation($phone);
742
+        $data = array();
743
+
744
+        #生成12个月数组
745
+        $startDate = $customerInformation->create_time;
746
+        $currentTime = strtotime($startDate);
747
+        $cyear = floor(date("Y",$currentTime));
748
+        $cMonth = floor(date("m",$currentTime));
749
+        for($i=0;$i<12;$i++){
750
+            $nMonth = $cMonth+$i;
751
+            $cyear = $nMonth == 13 ? ($cyear+1) : $cyear;
752
+            $nMonth = $nMonth > 12 ? $nMonth-12 : $nMonth;
753
+            $date = $cyear."-".$nMonth."-1";
754
+            $firstday = date('Y-m-01', strtotime($date));
755
+            $lastday = date('Y-m-t', strtotime($date));
756
+            $data[$i]['start_time'] = $firstday;
757
+            $data[$i]['end_time'] = $lastday;
758
+        }
759
+
760
+        $list = array();
761
+        #将数据对应填写
762
+        foreach ($data as $value) {
763
+            foreach ($monthGiftLog as $v) {
764
+                if(($value['start_time'] <= $v['dtime']) && ($v['dtime'] <= $value['end_time'])){
765
+                    $value['order_id'] = $v['order_id'];
766
+                    $value['dtime'] = $v['dtime'];
767
+                    $value['status'] = '已使用';
768
+                    $giftInfo = CustomerMonthGift::find($v['gift_id']);
769
+                    $goodsId = $giftInfo->goods_id;
770
+                    $goodsInfo = Goods::find($goodsId);
771
+                    $value['goods_id'] = $goodsId;
772
+                    $value['goods_name'] = $goodsInfo->name;
773
+                } else if($value['end_time'] < date('Y-m-d')){
774
+                    $value['status'] = '已过期';
775
+                } else {
776
+                    $value['status'] = '未使用';
777
+                }
778
+            }
779
+            $list[] = $value;
780
+        }
731 781
 
732
-        return view('customer/monthGiftLog',[]);
782
+        return view('customer/customermonthgiftlist',['data'=>$list]);
733 783
     }
734 784
 
735 785
     /**
@@ -741,18 +791,59 @@ class CustomerDepositController extends Controller
741 791
         $phone = $request->input('phone');
742 792
 
743 793
         $couponList = CustomerCoupons::getCustomerCouponsLog($phone);
794
+        $couponList = array_map(function($value){
795
+            $item = $value;
796
+            if($value['is_use'] == 1){
797
+                $item['status'] = '已使用';
798
+            } else if(time() <= strtotime($value['end_time'])){
799
+                $item['status'] = '未使用';
800
+            } else {
801
+                $item['status'] = '已过期';
802
+            }
803
+            return $item;
804
+        },$couponList);
744 805
 
745
-        return view('customer/customerCouponLog',['list'=>$couponList]);
806
+        return view('customer/customercouponlist',[
807
+            'data'=>$couponList
808
+        ]);
746 809
     }
747 810
 
748
-
811
+    /**
812
+     * 查询会员生日套餐领取记录
813
+     * @param Request $request
814
+     * @return \Illuminate\View\View
815
+     */
749 816
     public function birthdayGiftLog(Request $request) {
750 817
         $phone = $request->input('phone');
751 818
         $log = CustomerGiftReceives::getCustomerReceivesLog($phone,1);
752
-        $data = array_map(function($value){
753 819
 
754
-        },$log);
755
-        return view('customer/birthdayGiftLog',['list'=>$data]);
820
+        if(count($log) < 1){
821
+            $data = array();
822
+        } else {
823
+            #找到对应的商品列表
824
+
825
+            //1.找到对应的订单
826
+            $orderId = $log[0]['order_id'];
827
+            //2.获取所有的生日套餐的gift_id
828
+            $giftList = CustomerMonthGift::where('type',1)->pluck('id');
829
+            //3.从订单商品表中查找到该订单中gift_id是生日套餐的商品id
830
+            if(is_array($giftList)){
831
+                $orderGoodsSkus = OrderGoodsSkus::where('order_id',$orderId)->whereIn('gift_id',$giftList)->get();
832
+            } else {
833
+                $orderGoodsSkus = OrderGoodsSkus::where('order_id',$orderId)->where('gift_id',$giftList)->get();
834
+            }
835
+
836
+            foreach($orderGoodsSkus as $k=>$value) {
837
+                $goods = Goods::find($value['goods_id']);
838
+                $data[$k]['order_id'] = $orderId;
839
+                $data[$k]['goods_id'] = $goods['id'];
840
+                $data[$k]['goods_name'] = $goods['name'];
841
+                $data[$k]['dtime'] = $log[0]['dtime'];
842
+            }
843
+
844
+            $data = json_decode(json_encode($data),true);
845
+        }
846
+        return view('customer/customerbirthdaygiftlist',['data'=>$data]);
756 847
     }
757 848
 
758 849
 }

+ 202 - 0
app/Http/Controllers/Api/CustomerController.php

@@ -0,0 +1,202 @@
1
+<?php
2
+/**
3
+ * Created by PhpStorm.
4
+ * User: shensong
5
+ * Date: 2019/12/3
6
+ * Time: 16:00
7
+ */
8
+
9
+namespace App\Http\Controllers\Api;
10
+
11
+
12
+use App\Customer;
13
+use App\CustomerCoupons;
14
+use App\CustomerGiftReceives;
15
+use App\CustomerMonthGift;
16
+use App\CustomerVip;
17
+use App\Goods;
18
+use App\GoodsSkus;
19
+use App\Http\Controllers\Controller;
20
+use Illuminate\Http\Request;
21
+
22
+class CustomerController extends Controller
23
+{
24
+    /**
25
+     * 获取买家收货人地址列表
26
+     * @param Request $request
27
+     * @return array
28
+     */
29
+    public function getAddressList(Request $request) {
30
+        $phone = $request->input('phone',null);
31
+        if(is_null($phone)){
32
+            return self::returnValue(['买家手机号必填'],2000);
33
+        }
34
+
35
+        $list = Customer::select('receiverState','receiverCity','receiverAddress','fanTime','phone','name')->where('buyerMobile',$phone)->get();
36
+        $list = json_decode(json_encode($list),true);
37
+
38
+        return self::returnValue($list,200);
39
+    }
40
+
41
+    /**
42
+     * 获取用户会员信息
43
+     * @param Request $request
44
+     * @return array
45
+     */
46
+    public function getVipInformation(Request $request) {
47
+        $phone = $request->input('phone',null);
48
+        if(is_null($phone)){
49
+            return self::returnValue(['买家手机号必填'],2000);
50
+        }
51
+        #判断该用户是否为会员
52
+        $flag = CustomerVip::judgeWhetherTheUserIsAMember($phone);
53
+        if(!$flag){
54
+            return self::returnValue(['该用户还不是会员'],2014);
55
+        }
56
+
57
+        $customerInfo = CustomerVip::getCustomerInformation($phone);
58
+        $currentDate = date('Y-m-d',time());
59
+        $customer['vip_end_time'] = $customerInfo->vip_end_time;
60
+        $customer['name'] = $customerInfo->name;
61
+        $customer['birthday'] = date('m-d',strtotime($customerInfo->birthday));
62
+        $mtime = date('Y-m-01');
63
+
64
+        //生日套餐
65
+        $birthdayGift = CustomerGiftReceives::getCustomerReceivesLog($phone,1);
66
+        //判断生日礼
67
+        $birth_stime = date('m-01', strtotime($customerInfo->birthday));
68
+        $birth_etime = date('m-t', strtotime($customerInfo->birthday));
69
+        $today = date('m-d');
70
+
71
+        if($today>=$birth_stime && $today<=$birth_etime){
72
+            //生日期内,判断是否已领
73
+            $if_b_gift = DB::table('customer_gift_receives')->where('phone', $phone)->where('is_del',0)->where('gift_type', 1)->where('dtime', '>=', $mtime)->first();
74
+            if(empty($if_b_gift)){
75
+                $birthdayGiftStatus = 1;
76
+            } else {
77
+                $birthdayGiftStatus = 0;
78
+            }
79
+        }
80
+        if($birthdayGift){
81
+            $birthdayGiftNumber = 0;
82
+        } else {
83
+            $birthdayGiftNumber = 1;
84
+        }
85
+
86
+        //每月礼包
87
+        $num = CustomerGiftReceives::getCustomerResidualTimes($phone,$customerInfo->vip_end_time);
88
+        $if_m_gift = DB::table('customer_gift_receives')->where('phone', $phone)->where('is_del',0)->where('gift_type', 0)->where('dtime', '>=', $mtime)->first();
89
+        if(empty($if_m_gift) && ($num >0)){
90
+            $monthGiftStatus = 1;
91
+        } else {
92
+            $monthGiftStatus = 0;
93
+        }
94
+
95
+        //代金券
96
+        $coupons = CustomerCoupons::where('phone',$phone)->where('is_use',0)->where('end_time','>=',$currentDate)->count();
97
+
98
+        if($coupons > 0){
99
+            $couponStatus = 1;
100
+        } else {
101
+            $couponStatus = 0;
102
+        }
103
+        $customer['coupon_status'] = $couponStatus;//能否使用代金券
104
+        $customer['coupon_number'] = $coupons;//剩余代金券张数
105
+        $customer['birthday_gift_status'] = $birthdayGiftStatus;//能否领取生日礼包
106
+        $customer['birthday_gift_number'] = $birthdayGiftNumber;//生日礼包是否领取
107
+        $customer['month_gift_number'] = $num;//每月礼包剩余次数
108
+        $customer['month_gift_status'] = $monthGiftStatus;//能否领取当月礼包
109
+
110
+        return self::returnValue($customer,200);
111
+    }
112
+
113
+    /**
114
+     * 获取用户礼包商品列表
115
+     * @param Request $request
116
+     * @return array
117
+     */
118
+    public function getMonthGiftList(Request $request) {
119
+        $type = $request->input('type',0);
120
+        $phone = $request->input('phone',null);
121
+        if(($type == 1) && is_null($phone)){
122
+            return self::returnValue(['买家手机号必填'],2000);
123
+        }
124
+
125
+        #判断该用户是否为会员
126
+        $flag = CustomerVip::judgeWhetherTheUserIsAMember($phone);
127
+        if(!$flag){
128
+            return self::returnValue(['该用户还不是会员'],2014);
129
+        }
130
+
131
+        #判断该用户能否领取当月礼包
132
+        $flag = CustomerGiftReceives::judgeWhetherTheUserReceivesTheGiftBag($phone,$type);
133
+        if(!$flag){
134
+            return self::returnValue(['不能领取当月礼包'],2015);
135
+        }
136
+
137
+        //当月礼品
138
+        $mtime = date('Y-m-01');
139
+        if($type == 1){
140
+            $gift_info = CustomerMonthGift::where('type',1)->get();
141
+        } else {
142
+            $gift_info = CustomerMonthGift::where('mtime',$mtime)->where('type',0)->get();
143
+        }
144
+
145
+        $gift_info = json_decode(json_encode($gift_info), true);
146
+        $m_gift=array();
147
+        $b_gift=array();
148
+        foreach($gift_info as $k=>$v) {
149
+            //获取礼品信息
150
+            $goods_info = Goods::where('id', $v['goods_id'])->where('is_del',0)->first();
151
+            $sku = GoodsSkus::where('id', $v['sku_id'])->where('is_del', 0)->where(function ($query) {
152
+                $query->where('is_white', 1)->orWhere('quantity', '>', 0);
153
+            })->first();
154
+            if (empty($sku)) continue;
155
+            //计算实际库存 -还未到卖家云的量
156
+            $quantity = GoodsSkus::actualQuantity($v['sku_id']);
157
+            if ($quantity <= 0) {
158
+                continue;
159
+            }
160
+
161
+            $data = array();
162
+            $data['id'] = $v['id'];
163
+            $data['goods_name'] = $goods_info->name;
164
+            $data['propsName'] = $sku['propsName'];
165
+            $data['price'] = $sku['price'];
166
+            $data['picUrl'] = $goods_info->picUrl;
167
+            if ($v['type'] == 0) {
168
+                $m_gift[] = $data;
169
+            } else {
170
+                $b_gift[] = $data;
171
+            }
172
+        }
173
+
174
+        if($type == 1){
175
+            return self::returnValue($b_gift,200);
176
+        } else {
177
+            return self::returnValue($m_gift,200);
178
+        }
179
+    }
180
+
181
+    /**
182
+     * 获取用户优惠券列表
183
+     * @param Request $request
184
+     * @return array
185
+     */
186
+    public function getCouponsList(Request $request) {
187
+        $phone = $request->input('phone',null);
188
+        if(is_null($phone)){
189
+            return self::returnValue(['买家手机号必填'],2000);
190
+        }
191
+
192
+        #判断该用户是否为会员
193
+        $flag = CustomerVip::judgeWhetherTheUserIsAMember($phone);
194
+        if(!$flag){
195
+            return self::returnValue(['该用户还不是会员'],2014);
196
+        }
197
+
198
+        $list = CustomerCoupons::getCustomerCouponsLog($phone);
199
+        return self::returnValue($list,200);
200
+    }
201
+
202
+}

+ 12 - 3
app/Http/routes.php

@@ -310,6 +310,13 @@ Route::group(['prefix' => 'admin'], function(){
310 310
         Route::get('customer/vipUp','Admin\CustomerDepositController@vipUp');
311 311
         Route::get('customer/vipDel','Admin\CustomerDepositController@vipDel');
312 312
 
313
+        //会员每月礼品领取记录
314
+        Route::get('customer/monthGiftLog','Admin\CustomerDepositController@monthGiftLog');
315
+        //会员优惠券领取记录
316
+        Route::get('customer/couponLog','Admin\CustomerDepositController@couponLog');
317
+        //会员生日套餐领取记录
318
+        Route::get('customer/birthdayGiftLog','Admin\CustomerDepositController@birthdayGiftLog');
319
+
313 320
         //会员礼品管理
314 321
         Route::get('customer/giftList','Admin\CustomerDepositController@monthGiftList');
315 322
         Route::get('customer/giftAdd','Admin\CustomerDepositController@addMonthGift');
@@ -317,9 +324,6 @@ Route::group(['prefix' => 'admin'], function(){
317 324
         Route::post('customer/giftStore','Admin\CustomerDepositController@monthGiftStore');
318 325
         Route::post('customer/giftUpdate','Admin\CustomerDepositController@monthGiftUpdate');
319 326
 
320
-        //检索会员信息
321
-        Route::get('customer/vipInformation','Admin\CustomerDepositController@queryVipView');
322
-        Route::post('customer/queryVip','Admin\CustomerDepositController@queryVipInformation');
323 327
     });
324 328
     
325 329
 });
@@ -345,4 +349,9 @@ Route::group(['prefix' => 'api'], function() {
345 349
     Route::get('/order/getAddress', 'Api\OrderController@getAddress');
346 350
     Route::get('/order/getBalance', 'Api\OrderController@getBalance');
347 351
     Route::post('/order/setverify', 'Api\OrderController@setverify');
352
+
353
+    Route::get('/customer/addressList','Api\CustomerController@getAddressList');
354
+    Route::get('/customer/vipInformation','Api\CustomerController@getVipInformation');
355
+    Route::get('/customer/couponList','Api\CustomerController@getCouponsList');
356
+    Route::get('/customer/giftList','Api\CustomerController@getMonthGiftList');
348 357
 });

+ 0 - 0
resources/views/customer/customerInformationQuery.blade.php


+ 74 - 0
resources/views/customer/customerbirthdaygiftlist.blade.php

@@ -0,0 +1,74 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(session('info'))
5
+        <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
6
+            {{session('info')}}
7
+        </div>
8
+    @endif
9
+
10
+    <div class="page-container">
11
+        <div>
12
+
13
+        </div>
14
+        <div class="mt-20">
15
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
16
+                <thead>
17
+                <tr class="text-c">
18
+                    <th width="10%">编号</th>
19
+                    <th width="10%">使用时间</th>
20
+                    <th width="10%">订单编号</th>
21
+                    <th width="10%">商品编号</th>
22
+                    <th width="10%">商品名称</th>
23
+                </tr>
24
+                </thead>
25
+                <tbody>
26
+                @if($data)
27
+                    @foreach($data as $k=>$a)
28
+                        <tr class="text-c">
29
+                            <td class="text-c">{{($k+1)}}</td>
30
+                            <td class="text-c">{{isset($a['dtime']) ? $a['dtime'] : "--"}}</td>
31
+                            <td class="text-c">{{isset($a['order_id']) ? $a['order_id'] : "--"}}</td>
32
+                            <td class="text-c">{{isset($a['goods_id']) ? $a['goods_id'] : "--"}}</td>
33
+                            <td class="text-c">{{isset($a['goods_name']) ? $a['goods_name'] : "--"}}</td>
34
+                        </tr>
35
+                    @endforeach
36
+                @endif
37
+                </tbody>
38
+            </table>
39
+        </div>
40
+        <div id="page" class="page_div"></div>
41
+    </div>
42
+    <!--_footer 作为公共模版分离出去-->
43
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
44
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
45
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
46
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
47
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
48
+    <!--/_footer 作为公共模版分离出去-->
49
+    <!--/_footer 作为公共模版分离出去-->
50
+
51
+    <script type="text/javascript">
52
+
53
+        $(function(){
54
+            setTimeout("$('#info').hide()",3000);
55
+        });
56
+
57
+        {{--$("#page").paging({--}}
58
+        {{--pageNo:{{$page}},--}}
59
+        {{--totalPage: {{$pages}},--}}
60
+        {{--totalSize: {{$count}},--}}
61
+        {{--callback: function(num) {--}}
62
+        {{--var phone = $('#phone').val();--}}
63
+        {{--var name = $('#name').val();--}}
64
+        {{--var team_id = $('#team_id').val();--}}
65
+        {{--var admin_id = $('#admin_id').val();--}}
66
+        {{--location.href='vipList?page='+num + '&name='+name + '&phone='+phone+ '&team_id=' + team_id + '&admin_id=' + admin_id;--}}
67
+        {{--}--}}
68
+        {{--})--}}
69
+
70
+
71
+    </script>
72
+    </body>
73
+
74
+@endsection

+ 76 - 0
resources/views/customer/customercouponlist.blade.php

@@ -0,0 +1,76 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(session('info'))
5
+        <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
6
+            {{session('info')}}
7
+        </div>
8
+    @endif
9
+
10
+    <div class="page-container">
11
+        <div>
12
+
13
+        </div>
14
+        <div class="mt-20">
15
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
16
+                <thead>
17
+                <tr class="text-c">
18
+                    <th width="10%">代金券编号</th>
19
+                    <th width="10%">代金券金额</th>
20
+                    <th width="10%">到期时间</th>
21
+                    <th width="10%">代金券状态</th>
22
+                    <th width="10%">使用时间</th>
23
+                    <th width="10%">订单编号</th>
24
+                </tr>
25
+                </thead>
26
+                <tbody>
27
+                @if($data)
28
+                    @foreach($data as $k=>$a)
29
+                        <tr class="text-c">
30
+                            <td class="text-c">{{($k+1)}}</td>
31
+                            <td class="text-c">{{$a['coupon_price']}}</td>
32
+                            <td class="text-c">{{date("Y-m-d",strtotime($a['end_time']))}}</td>
33
+                            <td class="text-c">{{$a['status']}}</td>
34
+                            <td class="text-c">{{isset($a['use_time']) ? $a['use_time'] : "--"}}</td>
35
+                            <td class="text-c">{{isset($a['order_id']) ? $a['order_id'] : "--"}}</td>
36
+                        </tr>
37
+                    @endforeach
38
+                @endif
39
+                </tbody>
40
+            </table>
41
+        </div>
42
+        <div id="page" class="page_div"></div>
43
+    </div>
44
+    <!--_footer 作为公共模版分离出去-->
45
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
46
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
47
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
48
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
49
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
50
+    <!--/_footer 作为公共模版分离出去-->
51
+    <!--/_footer 作为公共模版分离出去-->
52
+
53
+    <script type="text/javascript">
54
+
55
+        $(function(){
56
+            setTimeout("$('#info').hide()",3000);
57
+        });
58
+
59
+        {{--$("#page").paging({--}}
60
+            {{--pageNo:{{$page}},--}}
61
+            {{--totalPage: {{$pages}},--}}
62
+            {{--totalSize: {{$count}},--}}
63
+            {{--callback: function(num) {--}}
64
+                {{--var phone = $('#phone').val();--}}
65
+                {{--var name = $('#name').val();--}}
66
+                {{--var team_id = $('#team_id').val();--}}
67
+                {{--var admin_id = $('#admin_id').val();--}}
68
+                {{--location.href='vipList?page='+num + '&name='+name + '&phone='+phone+ '&team_id=' + team_id + '&admin_id=' + admin_id;--}}
69
+            {{--}--}}
70
+        {{--})--}}
71
+
72
+
73
+    </script>
74
+    </body>
75
+
76
+@endsection

+ 78 - 0
resources/views/customer/customermonthgiftlist.blade.php

@@ -0,0 +1,78 @@
1
+@extends('admin/master')
2
+@section('content')
3
+    <body>
4
+    @if(session('info'))
5
+        <div class="Huialert Huialert-info" onclick="$(this).remove()" id="info">
6
+            {{session('info')}}
7
+        </div>
8
+    @endif
9
+
10
+    <div class="page-container">
11
+        <div>
12
+
13
+        </div>
14
+        <div class="mt-20">
15
+            <table class="table table-border table-bordered table-bg table-hover table-sort">
16
+                <thead>
17
+                <tr class="text-c">
18
+                    <th width="10%">礼品编号</th>
19
+                    <th width="10%">到期时间</th>
20
+                    <th width="10%">礼品状态</th>
21
+                    <th width="10%">使用时间</th>
22
+                    <th width="10%">订单编号</th>
23
+                    <th width="10%">商品编号</th>
24
+                    <th width="10%">商品名称</th>
25
+                </tr>
26
+                </thead>
27
+                <tbody>
28
+                @if($data)
29
+                    @foreach($data as $k=>$a)
30
+                        <tr class="text-c">
31
+                            <td class="text-c">{{($k+1)}}</td>
32
+                            <td class="text-c">{{$a['end_time']}}</td>
33
+                            <td class="text-c">{{$a['status']}}</td>
34
+                            <td class="text-c">{{isset($a['dtime']) ? $a['dtime'] : "--"}}</td>
35
+                            <td class="text-c">{{isset($a['order_id']) ? $a['order_id'] : "--"}}</td>
36
+                            <td class="text-c">{{isset($a['goods_id']) ? $a['goods_id'] : "--"}}</td>
37
+                            <td class="text-c">{{isset($a['goods_name']) ? $a['goods_name'] : "--"}}</td>
38
+                        </tr>
39
+                    @endforeach
40
+                @endif
41
+                </tbody>
42
+            </table>
43
+        </div>
44
+        <div id="page" class="page_div"></div>
45
+    </div>
46
+    <!--_footer 作为公共模版分离出去-->
47
+    <script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script>
48
+    <script type="text/javascript" src="/admin/lib/layer/2.4/layer.js"></script>
49
+    <script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script>
50
+    <script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>
51
+    <script type="text/javascript" src="/admin/lib/page/paging.js"></script>
52
+    <!--/_footer 作为公共模版分离出去-->
53
+    <!--/_footer 作为公共模版分离出去-->
54
+
55
+    <script type="text/javascript">
56
+
57
+        $(function(){
58
+            setTimeout("$('#info').hide()",3000);
59
+        });
60
+
61
+        {{--$("#page").paging({--}}
62
+        {{--pageNo:{{$page}},--}}
63
+        {{--totalPage: {{$pages}},--}}
64
+        {{--totalSize: {{$count}},--}}
65
+        {{--callback: function(num) {--}}
66
+        {{--var phone = $('#phone').val();--}}
67
+        {{--var name = $('#name').val();--}}
68
+        {{--var team_id = $('#team_id').val();--}}
69
+        {{--var admin_id = $('#admin_id').val();--}}
70
+        {{--location.href='vipList?page='+num + '&name='+name + '&phone='+phone+ '&team_id=' + team_id + '&admin_id=' + admin_id;--}}
71
+        {{--}--}}
72
+        {{--})--}}
73
+
74
+
75
+    </script>
76
+    </body>
77
+
78
+@endsection