Commit 85494b6e authored by zw's avatar zw

经纪人搜索

parent b040ed78
...@@ -14,6 +14,7 @@ class AAgents extends BaseModel ...@@ -14,6 +14,7 @@ class AAgents extends BaseModel
{ {
protected $table = 'a_agents'; protected $table = 'a_agents';
/** /**
* 返回经纪人和部门信息 * 返回经纪人和部门信息
* *
...@@ -191,13 +192,16 @@ class AAgents extends BaseModel ...@@ -191,13 +192,16 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function verifyUser($field,$join,$params) public function verifyUser($field, $join, $params)
{ {
return $this->field($field)
$r = $this->field($field)
->alias('a') ->alias('a')
->join($join) ->join($join)
->where($params) ->where($params)
->find(); ->find();
//echo $this->getLastSql();
return $r;
} }
/** /**
...@@ -325,17 +329,15 @@ class AAgents extends BaseModel ...@@ -325,17 +329,15 @@ class AAgents extends BaseModel
return $data; return $data;
} }
/** /**
* 批量获取经纪人 * 批量获取经纪人
*
* @param $params * @param $params
* @return false|\PDOStatement|string|\think\Collection * @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getAgentsByStoreId($params){ public function getAgentsByStoreId($params)
$result = Db::table($this->table) {
$result = Db::table($this->table)
->field("id") ->field("id")
->where($params) ->where($params)
->select(); ->select();
...@@ -343,20 +345,35 @@ class AAgents extends BaseModel ...@@ -343,20 +345,35 @@ class AAgents extends BaseModel
return $result; return $result;
} }
/** public function getAgentsInfoByAgentId($field, $params)
* 检查是否有权限 {
* $where_ = [];
* @param $id if (isset($params["agent_id"])) {
* @return array|false|\PDOStatement|string|\think\Model $where_["a.id"] = $params["agent_id"];
* @throws \think\db\exception\DataNotFoundException }
* @throws \think\db\exception\ModelNotFoundException $where_["a.status"] = 0;
* @throws \think\exception\DbException
*/ $result = Db::table($this->table)
public function agentsAuth($id) { ->field($field)
return $this->alias('a') ->alias("a")
->field('b.id') ->join("a_store b", "a.store_id = b.id", "left")
->join('auth_group b','a.auth_group_id=b.id','left') ->join("a_district c", "a.district_id = c.id", "left")
->where("FIND_IN_SET({$id},b.rules)") ->where($where_)
->find(); ->select();
return $result;
} }
public function searchAgentsByKeyword($field, $params)
{
$params["status"] = 0;
$result = Db::table($this->table)
->field($field)
->where($params)
->select();
return $result;
}
} }
\ No newline at end of file
...@@ -302,6 +302,8 @@ Route::group('broker', [ ...@@ -302,6 +302,8 @@ Route::group('broker', [
'dayStatement' => ['api_broker/Statement/dayStatement', [ 'method' => 'get|post' ] ], 'dayStatement' => ['api_broker/Statement/dayStatement', [ 'method' => 'get|post' ] ],
'searchAgents' => ['api_broker/OrderLog/searchAgents', [ 'method' => 'get|post' ] ],
'center' => ['api_broker/MyCenter/center', [ 'method' => 'get|post' ] ], 'center' => ['api_broker/MyCenter/center', [ 'method' => 'get|post' ] ],
......
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