Commit 33976746 authored by zhuwei's avatar zhuwei

黑名单列表

parent c84dc9ce
...@@ -958,6 +958,47 @@ class Broker extends Basic ...@@ -958,6 +958,47 @@ class Broker extends Basic
} }
/**
* 黑名单列表
* User: 朱伟
* Date: 2018年12月12日
* Time: 15:35:40
*/
public function getAgentsBlackList()
{
$params = $this->params;
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$m_agents_black_list = new AAgentsBlackList();
if (isset($params["name"])) {
$get_params['Agents.name'] = $params["name"];
}
if (isset($params["phone"])) {
$get_params['Agents.phone'] = $params["phone"];
}
$get_params['BlackList.status'] = 0;
$field = 'BlackList.agents_id,';
$field .= 'Agents.status,';
$field .= 'Agents.name,';
$field .= 'Agents.phone,';
$field .= 'Agents.img,';
$field .= 'Agents.create_time,';
$field .= 'Store.store_name';
$res = $m_agents_black_list->getAgentsBlackList($pageNo,$pageSize,$field,$get_params);
$res_total = $m_agents_black_list->getDatasTotal($get_params);
foreach($res as $k=>$v)
{
$res[$k]['head_portrait'] = AGENTHEADERIMGURL . $v['img'];
}
$data['total'] =$res_total;
$data['data_list'] =$res;
return $this->response("200", "成功",$data);
}
} }
\ No newline at end of file
...@@ -19,10 +19,7 @@ class AAgentsBlackList extends Model ...@@ -19,10 +19,7 @@ class AAgentsBlackList extends Model
return $this->insertGetId($data); return $this->insertGetId($data);
} }
/**
* 查询数据
* 朱伟 2018-07-04
*/
public function getDatas($field,$params) public function getDatas($field,$params)
{ {
$result = Db::table($this->table) $result = Db::table($this->table)
...@@ -34,15 +31,32 @@ class AAgentsBlackList extends Model ...@@ -34,15 +31,32 @@ class AAgentsBlackList extends Model
return $result; return $result;
} }
public function getAgentsBlackList($pageNo,$pageSize,$field,$params)
{
$order = "BlackList.create_time desc";
$result = Db::table($this->table)
->field($field)
->alias('BlackList')
->join('a_agents Agents', 'BlackList.agents_id = Agents.id', 'left')
->join('a_store Store', 'Agents.store_id = Store.id', 'left')
->where($params)
->limit($pageSize)
->page($pageNo)
->order($order)
->select();
// dump($this->getLastSql());
return $result;
}
/** /**
* 查询数据统计 * 查询数据统计
* 朱伟 2018-08-10
*/ */
public function getDatasTotal($field,$params) public function getDatasTotal($params)
{ {
$result = Db::table($this->table) $result = Db::table($this->table)
->field($field) ->alias('BlackList')
//->alias('a') ->join('a_agents Agents', 'BlackList.agents_id = Agents.id', 'left')
->join('a_store Store', 'Agents.store_id = Store.id', 'left')
->where($params) ->where($params)
->count(); ->count();
//dump($this->getLastSql()); //dump($this->getLastSql());
...@@ -52,7 +66,6 @@ class AAgentsBlackList extends Model ...@@ -52,7 +66,6 @@ class AAgentsBlackList extends Model
/** /**
* 更新数据 * 更新数据
* 朱伟 2018-07-04
*/ */
public function updateDatas($params) public function updateDatas($params)
{ {
......
...@@ -378,6 +378,7 @@ Route::group('index', [ ...@@ -378,6 +378,7 @@ Route::group('index', [
'downloadFile' => [ 'index/news/downloadFile', [ 'method' => 'GET|POST' ] ], //新增商学院资讯 'downloadFile' => [ 'index/news/downloadFile', [ 'method' => 'GET|POST' ] ], //新增商学院资讯
'addAgentsBlackList' => [ 'index/broker/addAgentsBlackList', [ 'method' => 'GET|POST' ] ],//添加黑名单 'addAgentsBlackList' => [ 'index/broker/addAgentsBlackList', [ 'method' => 'GET|POST' ] ],//添加黑名单
'getAgentsBlackList' => [ 'index/broker/getAgentsBlackList', [ '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