Commit 6b2e6d12 authored by hujun's avatar hujun

新增vip用户权限验证

parent 6d61af43
...@@ -88,15 +88,18 @@ class Client extends Basic ...@@ -88,15 +88,18 @@ class Client extends Basic
} }
} }
if ($data['start'] == -1) { switch ($data['start']) {
$this->code = 101; case -1 :
$this->msg = '该用户已存在'; $this->code = 101;
$this->msg = '该用户已存在';break;
case -2 :
$this->code = 101;
$this->msg = '此号码为虚拟号码';break;
case -3 :
$this->code = 101;
$this->msg = '没有权限';break;
} }
if ($data['start'] == -2) {
$this->code = 101;
$this->msg = '此号码为虚拟号码';
}
} else { } else {
$data['start'] = $this->user->getClient($this->params['id']); $data['start'] = $this->user->getClient($this->params['id']);
} }
......
...@@ -349,14 +349,16 @@ class Member extends Basic{ ...@@ -349,14 +349,16 @@ class Member extends Basic{
} }
} }
if ($result == -1) { switch ($result) {
$this->code = 101; case -1 :
$this->msg = '该用户已存在'; $this->code = 101;
} $this->msg = '该用户已存在';break;
case -2 :
if ($result == -2) { $this->code = 101;
$this->code = 101; $this->msg = '此号码为虚拟号码';break;
$this->msg = '此号码为虚拟号码'; case -3 :
$this->code = 101;
$this->msg = '没有权限';break;
} }
$this->operating_records($this->userId, $type=3, $remark, $this->params['id']); $this->operating_records($this->userId, $type=3, $remark, $this->params['id']);
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace app\model; namespace app\model;
use app\api_broker\service\VipService;
use think\Db; use think\Db;
use think\Model; use think\Model;
...@@ -257,6 +258,13 @@ class Users extends Model ...@@ -257,6 +258,13 @@ class Users extends Model
} }
if (!empty($data['agents_id'])) { if (!empty($data['agents_id'])) {
$insert_data['agent_id'] = $data['agents_id']; $insert_data['agent_id'] = $data['agents_id'];
if ($data['vip'] == 1) {
$vip = new VipService();
if ($vip->vip($this->$insert_data['agent_id'])) {
return -3;
}
}
} }
if (!empty($data['industry_type'])) { if (!empty($data['industry_type'])) {
$insert_data['industry_type'] = $data['industry_type']; $insert_data['industry_type'] = $data['industry_type'];
...@@ -291,7 +299,6 @@ class Users extends Model ...@@ -291,7 +299,6 @@ class Users extends Model
} else { } else {
$return_id = -2; $return_id = -2;
} }
} else { } else {
$return_id = -1; $return_id = -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment