Commit 872994e4 authored by zhuwei's avatar zhuwei

bug

parent 91594a82
...@@ -118,7 +118,7 @@ class LookShop extends Basic ...@@ -118,7 +118,7 @@ class LookShop extends Basic
$params_["id"] = $this->agentId; $params_["id"] = $this->agentId;
$result = $model->searchAgentsByKeyword("id,store_id,district_id,level", $params_); $result = $model->searchAgentsByKeyword("id,store_id,district_id,level", $params_);
$field = "id,store_id,level,name,phone,img"; $field = "a.id,a.store_id,a.level,a.name,a.phone,a.img,b.store_name";
//店长 //店长
if($result[0]["level"] == 20){ if($result[0]["level"] == 20){
...@@ -128,7 +128,7 @@ class LookShop extends Basic ...@@ -128,7 +128,7 @@ class LookShop extends Basic
$where_["district_id"] = $result[0]["district_id"]; $where_["district_id"] = $result[0]["district_id"];
} }
$where_["status"] = 0; $where_["a.status"] = 0;
$agentList = $this->agentsModel->getAgentByIdV2($field, $where_, $page_no, $page_size); $agentList = $this->agentsModel->getAgentByIdV2($field, $where_, $page_no, $page_size);
......
...@@ -291,34 +291,36 @@ class AAgents extends BaseModel ...@@ -291,34 +291,36 @@ class AAgents extends BaseModel
return $result; return $result;
} }
public function getAgentByIdV2($field = "id", $params, $page_no, $page_size) public function getAgentByIdV2($field = "a.id", $params, $page_no, $page_size)
{ {
$where_ = []; $where_ = [];
if (isset($params["agent_id"])) { if (isset($params["agent_id"])) {
$where_["id"] = $params["agent_id"]; $where_["a.id"] = $params["agent_id"];
} }
if (isset($params["name"])) { if (isset($params["name"])) {
$where_["name"] = $params["name"]; $where_["a.name"] = $params["name"];
} }
if (isset($params["phone"])) { if (isset($params["phone"])) {
$where_["phone"] = $params["phone"]; $where_["a.phone"] = $params["phone"];
} }
if (isset($params["store_id"])) { if (isset($params["store_id"])) {
$where_["store_id"] = $params["store_id"]; $where_["a.store_id"] = $params["store_id"];
} }
if (isset($params["district_id"])) { if (isset($params["district_id"])) {
$where_["district_id"] = $params["district_id"]; $where_["a.district_id"] = $params["district_id"];
} }
if (isset($params["status"])) { if (isset($params["status"])) {
$where_["status"] = $params["status"]; $where_["a.status"] = $params["status"];
} }
if (isset($params["level"])) { if (isset($params["level"])) {
$where_["level"] = $params["level"]; $where_["a.level"] = $params["level"];
} }
if (isset($params['in_id'])) { if (isset($params['in_id'])) {
$where_['id'] = [ 'in', $params['in_id'] ]; $where_['a.id'] = [ 'in', $params['in_id'] ];
} }
$result = $this->field($field) $result = $this->field($field)
->alias('a')
->join('a_store b', 'a.store_id = b.id', 'left')
->where($where_) ->where($where_)
->limit($page_size) ->limit($page_size)
->page($page_no) ->page($page_no)
......
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