zhangguidong 2 years ago
parent
commit
cb6a1af24b

+ 3 - 1
application/store/controller/Goods.php

@@ -278,7 +278,9 @@ class Goods extends Controller
                 $this->error('输入赠送用户手机号');
             }
             $mid = Db::name('member')->where('phone',$data['phone'])->value('id');
-
+            if(empty($mid)){
+                $this->error('手机号不存在');
+            }
             $inventory = Db::name($this->table)->where('id',$data['id'])->value('inventory');
 
             $info = Db::name($this->table)->where('id',$data['id'])->find();

+ 3 - 0
application/store/controller/Goods1.php

@@ -248,6 +248,9 @@ class Goods1 extends Controller
                 $this->error('输入赠送用户手机号');
             }
             $mid = Db::name('member')->where('phone',$data['phone'])->value('id');
+            if(empty($mid)){
+                $this->error('手机号不存在');
+            }
             $inventory = Db::name($this->table)->where('id',$data['id'])->value('inventory');
 
             $info = Db::name($this->table)->where('id',$data['id'])->find();

+ 3 - 0
application/store/controller/Goods2.php

@@ -251,6 +251,9 @@ class Goods2 extends Controller
                 $this->error('输入赠送用户手机号');
             }
             $mid = Db::name('member')->where('phone',$data['phone'])->value('id');
+            if(empty($mid)){
+                $this->error('手机号不存在');
+            }
             $inventory = Db::name($this->table)->where('id',$data['id'])->value('inventory');
 
             $info = Db::name($this->table)->where('id',$data['id'])->find();