Commit 6b2e6d12 authored by hujun's avatar hujun

新增vip用户权限验证

parent 6d61af43
......@@ -88,15 +88,18 @@ class Client extends Basic
}
}
if ($data['start'] == -1) {
$this->code = 101;
$this->msg = '该用户已存在';
switch ($data['start']) {
case -1 :
$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 {
$data['start'] = $this->user->getClient($this->params['id']);
}
......
......@@ -349,14 +349,16 @@ class Member extends Basic{
}
}
if ($result == -1) {
$this->code = 101;
$this->msg = '该用户已存在';
}
if ($result == -2) {
$this->code = 101;
$this->msg = '此号码为虚拟号码';
switch ($result) {
case -1 :
$this->code = 101;
$this->msg = '该用户已存在';break;
case -2 :
$this->code = 101;
$this->msg = '此号码为虚拟号码';break;
case -3 :
$this->code = 101;
$this->msg = '没有权限';break;
}
$this->operating_records($this->userId, $type=3, $remark, $this->params['id']);
......
......@@ -2,6 +2,7 @@
namespace app\model;
use app\api_broker\service\VipService;
use think\Db;
use think\Model;
......@@ -257,6 +258,13 @@ class Users extends Model
}
if (!empty($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'])) {
$insert_data['industry_type'] = $data['industry_type'];
......@@ -291,7 +299,6 @@ class Users extends Model
} else {
$return_id = -2;
}
} else {
$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