Commit 21801b28 authored by zhuwei's avatar zhuwei

添加黑名单

parent 78b6d61e
...@@ -14,6 +14,8 @@ use app\api_broker\service\CallPhoneService; ...@@ -14,6 +14,8 @@ use app\api_broker\service\CallPhoneService;
use app\api_broker\service\PushMessageService; use app\api_broker\service\PushMessageService;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\model\AAgents; use app\model\AAgents;
use app\model\AAgentsBlackList;
use app\model\AAgentsBlackListImg;
use app\model\ABindingDevice; use app\model\ABindingDevice;
use app\model\AOperatingRecords; use app\model\AOperatingRecords;
use app\model\AStore; use app\model\AStore;
...@@ -895,4 +897,67 @@ class Broker extends Basic ...@@ -895,4 +897,67 @@ class Broker extends Basic
return $this->response($code, $msg,['data'=>$list,'total'=>$total]); return $this->response($code, $msg,['data'=>$list,'total'=>$total]);
} }
/**
* 添加黑名单
* User: 朱伟
* Date: 2018年12月12日
* Time: 11:28:01
*/
public function addAgentsBlackList(){
$params = $this->params;
/* $params = array(
"agents_id" => 6524,
"content" => 'ceshi',
);*/
if (!isset($params["agents_id"])) {
return $this->response("101", "请求参数错误");
}
$save_data['status'] = 4;
$save_data['id'] = $params['agents_id'];
$broker_service = new BrokerService();
$data = $broker_service->updateStatus($save_data, $this->userId);
if ($data['status'] == 'fail') {
return $this->response("101", $data['msg']);
}
$m_agents_black_list = new AAgentsBlackList();
$m_agents_black_list_img = new AAgentsBlackListImg();
//先判断是否已经存在数据
$field = 'id,status';
$get_params['status'] = 0;
$get_params['agents_id'] = $params["agents_id"];
$get_data_res = $m_agents_black_list->getDatas($field, $get_params);
if($get_data_res){//如果存在
$res = true ;
}else{//不存在则新增数据
$insert["agents_id"] = $params['agents_id'];
$insert["content"] = $params['content'];
$insert["status"] = 0;
$res = $m_agents_black_list->saveData($insert);
if($res && $params["img_info"]){
foreach ($params["img_info"] as $k=>$v){
$insert=[];
$insert["file_name"] = $v['file_name'];
$insert["father_id"] = $res;
$insert["type"] = 0;
$insert["status"] = 0;
$res = $m_agents_black_list_img->saveData($insert);
}
}
}
if ($res) {
return $this->response("200", "成功");
} else {
return $this->response("101", "失败");
}
}
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ class AAgentsBlackList extends Model ...@@ -16,7 +16,7 @@ class AAgentsBlackList extends Model
$data['create_time'] = $time; $data['create_time'] = $time;
$data['update_time'] = $time; $data['update_time'] = $time;
return $this->insert($data); return $this->insertGetId($data);
} }
/** /**
......
...@@ -373,9 +373,12 @@ Route::group('index', [ ...@@ -373,9 +373,12 @@ Route::group('index', [
'getRandKingListByAgentId' => ['index/RankingList/getRandKingListByAgentId', ['method' => 'GET|POST']], 'getRandKingListByAgentId' => ['index/RankingList/getRandKingListByAgentId', ['method' => 'GET|POST']],
'getStoreRandKingListByAgentId' => ['index/RankingList/getStoreRandKingListByAgentId', ['method' => 'GET|POST']], 'getStoreRandKingListByAgentId' => ['index/RankingList/getStoreRandKingListByAgentId', ['method' => 'GET|POST']],
'getRecordsList' => ['index/broker/getRecordsList', ['method' => 'post|get']],//解绑或绑定经纪人设备id 'getRecordsList' => [ 'index/broker/getRecordsList', [ 'method' => 'post|get' ] ],//解绑或绑定经纪人设备id
'downloadFile' => [ 'index/news/downloadFile', [ 'method' => 'GET|POST' ] ], //新增商学院资讯
'addAgentsBlackList' => [ 'index/broker/addAgentsBlackList', [ 'method' => 'GET|POST' ] ],//添加黑名单
'downloadFile' => ['index/news/downloadFile', ['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