Commit beebd8a3 authored by hujun's avatar hujun

修改监督执行列表

parent 95ddf0a5
......@@ -10,6 +10,8 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\VerifyService;
use app\model\AAgents;
use app\model\SSupervision;
class Supervise extends Basic
......@@ -86,17 +88,18 @@ class Supervise extends Basic
$supervision = new SSupervision();
$fields = 'longitude,latitude,address,content,img_url,b.name,a.create_time';
$verify = new AAgents();
$agent_data = $verify->getAgentInfo('level,store_id,district_id', $this->params['agent_id']);
if (isset($this->params['agent_id'])) {
$where['agent_id'] = $this->params['agent_id'];
}
if (isset($this->params['district_id'])) {
$where['district_id'] = $this->params['district_id'];
}
if (isset($this->params['store_id'])) {
$where['store_id'] = $this->params['store_id'];
switch ($agent_data['level']) {
case 20 :
$where = 'a.store_id = '.$agent_data['store_id'];break;
case 30 :
$where = 'a.district_id = '.$agent_data['district_id'];break;
case 40 :
$where = 'a.store_id = '.$agent_data['store_id'] . ' or a.district_id = '.$agent_data['district_id'];break;
default :
$where = 'agent_id = '.$agent_data['agent_id'];
}
if (empty($where)) {
......
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