Browse Source

会员部分修改

shensong 5 years ago
parent
commit
d06d39ef43
2 changed files with 3 additions and 1 deletions
  1. 2 0
      app/CustomerGiftReceives.php
  2. 1 1
      app/Http/Controllers/Api/CustomerController.php

+ 2 - 0
app/CustomerGiftReceives.php

@@ -10,6 +10,7 @@ namespace App;
10 10
 
11 11
 
12 12
 use Illuminate\Database\Eloquent\Model;
13
+use Illuminate\Support\Facades\DB;
13 14
 
14 15
 class CustomerGiftReceives extends Model
15 16
 {
@@ -54,6 +55,7 @@ class CustomerGiftReceives extends Model
54 55
         $self = new self();
55 56
         $mtime = date('Y-m-01');
56 57
         if($type == 1){
58
+            $customerInfo = CustomerVip::getCustomerInformation($phone);
57 59
             $num = CustomerGiftReceives::getCustomerResidualTimes($phone,$customerInfo->vip_end_time);
58 60
             $if_m_gift = DB::table('customer_gift_receives')->where('phone', $phone)->where('is_del',0)->where('gift_type', 0)->where('dtime', '>=', $mtime)->first();
59 61
             if(empty($if_m_gift) && ($num >0)){

+ 1 - 1
app/Http/Controllers/Api/CustomerController.php

@@ -132,7 +132,7 @@ class CustomerController extends Controller
132 132
     public function getMonthGiftList(Request $request) {
133 133
         $type = $request->input('type',0);
134 134
         $phone = $request->input('phone',null);
135
-        if(($type == 1) && is_null($phone)){
135
+        if(is_null($phone)){
136 136
             return self::returnValue(['买家手机号必填'],2000);
137 137
         }
138 138