Commit e6785dcb authored by hujun's avatar hujun

约带看

parent ddee833e
...@@ -10,6 +10,7 @@ namespace app\index\controller; ...@@ -10,6 +10,7 @@ namespace app\index\controller;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\model\AAgents;
use app\model\OReportModel; use app\model\OReportModel;
class Report extends Basic class Report extends Basic
...@@ -28,6 +29,20 @@ class Report extends Basic ...@@ -28,6 +29,20 @@ class Report extends Basic
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$m_report = new OReportModel(); $m_report = new OReportModel();
$m_agent = new AAgents();
switch ($this->params['type']) {
case 1 :
$store_id = $m_agent->getAgentFieldById($this->userId, 'store_id');
$where['d.store_id'] = $store_id;
break;
case 2 :
$district_id = $m_agent->getAgentFieldById($this->userId, 'district_id');
$where['d.district_id'] = $district_id;
break;
case 3 :
break;
}
$data['code'] = 200; $data['code'] = 200;
$data['msg'] = ""; $data['msg'] = "";
$where["a.status"] = 0; $where["a.status"] = 0;
...@@ -66,14 +81,14 @@ class Report extends Basic ...@@ -66,14 +81,14 @@ class Report extends Basic
$field = 'b.id as order_id,a.user_name,a.user_phone,a.create_time,a.report_agent_name,c.internal_title,a.predict_see_time'; $field = 'b.id as order_id,a.user_name,a.user_phone,a.create_time,a.report_agent_name,c.internal_title,a.predict_see_time';
$field .= ',a.id,b.order_no'; $field .= ',a.id,b.order_no';
try { // try {
$list = $m_report->getReportList($pageNo, $pageSize, 'a.id desc', $field, $where); $list = $m_report->getReportList($pageNo, $pageSize, 'a.id desc', $field, $where);
$data['data']['total'] = $m_report->getAddReportListTotal($where); $data['data']['total'] = $m_report->getAddReportListTotal($where);
$data['data']['list'] = $list; $data['data']['list'] = $list;
} catch (\Exception $e) { // } catch (\Exception $e) {
$data['code'] = 101; // $data['code'] = 101;
$data['code'] = '内部错误:' . $e->getMessage(); // $data['code'] = '内部错误:' . $e->getMessage();
} // }
return $this->response($data['code'], $data['msg'], $data['data']); return $this->response($data['code'], $data['msg'], $data['data']);
} }
......
...@@ -745,6 +745,7 @@ class OReportModel extends Model ...@@ -745,6 +745,7 @@ class OReportModel extends Model
{ {
$result = $this->db->field($field) $result = $this->db->field($field)
->alias("a") ->alias("a")
->join("a_agents d", "a.report_agent_id = d.id", "left")
->join("o_order b", "a.id = b.f_id", "left") ->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left") ->join("g_houses c", "b.house_id = c.id", "left")
->where($params) ->where($params)
...@@ -764,6 +765,7 @@ class OReportModel extends Model ...@@ -764,6 +765,7 @@ class OReportModel extends Model
public function getAddReportListTotal($params) public function getAddReportListTotal($params)
{ {
return $this->db->alias("a") return $this->db->alias("a")
->join("a_agents d", "a.report_agent_id = d.id", "left")
->join("o_order b", "a.id = b.f_id", "left") ->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left") ->join("g_houses c", "b.house_id = c.id", "left")
->where($params) ->where($params)
......
...@@ -380,8 +380,10 @@ Route::group('index', [ ...@@ -380,8 +380,10 @@ Route::group('index', [
//站点相关 //站点相关
'addSite' => ['index/Site/addSite', ['method' => 'POST|GET']], //获取站点列表 朱伟 2018-10-18 'addSite' => ['index/Site/addSite', ['method' => 'POST|GET']], //获取站点列表 朱伟 2018-10-18
'getSiteList' => ['index/Site/getSiteList', ['method' => 'POST|GET']], //获取站点列表 朱伟 2018-10-18 'getSiteList' => ['index/Site/getSiteList', ['method' => 'POST|GET']], //获取站点列表 朱伟 2018-10-18
'delImageDepot_Site' => ['index/Site/delImageDepot', ['method' => 'POST|GET']], //关闭或开启站点 朱伟 2018-10-18 'delImageDepot_Site' => ['index/Site/delImageDepot', ['method' => 'POST|GET']], //关闭或开启站点 朱伟 2018-10-18
'inspectionRecordAll' => ['index/Report/inspectionRecordAll', ['method' => 'GET']], //全部约带看 'inspectionRecordStore/:type' => ['index/Report/inspectionRecordAll', ['method' => 'GET'], ['type'=>1]], //全部约带看
'inspectionRecordDistrict/:type' => ['index/Report/inspectionRecordAll', ['method' => 'GET'],['type'=>2]], //全部约带看
'inspectionRecordAll/:type' => ['index/Report/inspectionRecordAll', ['method' => 'GET'],['type'=>3]], //全部约带看
'setSite' => ['index/auth/setSite', ['method' => 'GET|POST']], //设置角色站点 'setSite' => ['index/auth/setSite', ['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