Commit f808e541 authored by zhuwei's avatar zhuwei

vip 上下架

parent 9c2a789f
...@@ -182,9 +182,9 @@ class User extends Basic ...@@ -182,9 +182,9 @@ class User extends Basic
$params = $this->params; $params = $this->params;
/*$params = array( /*$params = array(
"user_id" => 3, "user_id" => 59089,
"agent_id" => 9, "agent_id" => 9,
"type" =>"last", "type" =>"next",
);*/ );*/
$checkResult = $this->validate($params, "UserGetLastOrNextUserIdValidate.verifyStatus"); $checkResult = $this->validate($params, "UserGetLastOrNextUserIdValidate.verifyStatus");
...@@ -193,7 +193,7 @@ class User extends Basic ...@@ -193,7 +193,7 @@ class User extends Basic
} }
// 判断是 杭州还是上海 // 判断是 杭州还是上海
$where['city'] = trim($this->city); $where['city'] = trim($this->city)? trim($this->city) :'上海市';
if ($params['type'] == 'last') { if ($params['type'] == 'last') {
$where['id'] = [ 'gt', $params['user_id'] ]; $where['id'] = [ 'gt', $params['user_id'] ];
$order = 'id asc'; $order = 'id asc';
...@@ -202,7 +202,6 @@ class User extends Basic ...@@ -202,7 +202,6 @@ class User extends Basic
$where['id'] = [ 'lt', $params['user_id'] ]; $where['id'] = [ 'lt', $params['user_id'] ];
$order = 'id desc'; $order = 'id desc';
} }
//dump($where);
$field = 'id,user_nick,agent_id,vip'; $field = 'id,user_nick,agent_id,vip';
$user = new Users(); $user = new Users();
$user_res = $user->getLastOrNextUserID($where, $field, $limit = 1, $order); $user_res = $user->getLastOrNextUserID($where, $field, $limit = 1, $order);
...@@ -212,7 +211,8 @@ class User extends Basic ...@@ -212,7 +211,8 @@ class User extends Basic
// 判断是否vip客户,如果是 只有是当前经纪人自己的客户才能查看 // 判断是否vip客户,如果是 只有是当前经纪人自己的客户才能查看
//vip客户 0:否 1:是 //vip客户 0:否 1:是
if (($user_res['vip'] == 1) && ($user_res['agent_id'] != $params['agent_id'])) {
if (($user_res[0]['vip'] == 1) && ($user_res[0]['agent_id'] != $params['agent_id'])) {
return $this->response("201", "vip 非客方", ['user_id'=>$user_res[0]['id']]); return $this->response("201", "vip 非客方", ['user_id'=>$user_res[0]['id']]);
} }
......
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