Commit 499e15ef authored by hujun's avatar hujun

门店拜访定位地址和门店地址

parent 38ab8f4c
......@@ -105,13 +105,13 @@ class Supervise extends Basic
if ($agent_data['level'] == 10) {
$where = 'a.user_id = '.$this->params['agent_id'];
} else {
$where = 'b.shop_id = '.$agent_data['store_id'];
$where = 'b.store_id = '.$agent_data['store_id'];
}
//拜访类型(0代表门店拜访、1代表监督执行)
if (empty($this->params['visit_type'])) {
$where .= ' AND visit_type = 0';
$fields = 'longitude,latitude,address,a.remarks,scene_photo,b.name,a.created,leader_name,leader_phone,b.phone,agentshopname';
$fields = 'a.longitude,a.latitude,c.province,c.city,c.district,c.address as agent_address,a.address,a.remarks,scene_photo,b.name,a.created,leader_name,leader_phone,b.phone,agentshopname';
} else {
$where .= ' AND visit_type = 1';
$fields = 'longitude,latitude,address,a.remarks,scene_photo,b.name,a.created';
......@@ -125,6 +125,11 @@ class Supervise extends Basic
$data['list'] = $supervision->getVisitorsList($pageNo, $pageSize, 'a.id desc', $fields, $where);
if (empty($this->params['visit_type'])) {
foreach ($data['list'] as $k => $v) {
$data['list'][$k]['agent_address'] = $data['list'][$k]['province'].$data['list'][$k]['city'].$data['list'][$k]['district'].$data['list'][$k]['agent_address'];
}
}
foreach ($data['list'] as $k=>$v) {
$data['list'][$k]['scene_photo'] = CK_IMG_URL .'images/supervise/' . $v['scene_photo'];
}
......
......@@ -19,6 +19,7 @@ class AgentsVisitors extends BaseModel
public function getVisitorsList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
return $this->field($field)->alias('a')
->join('a_agents b', 'a.user_id = b.id','left')
->join('a_store c','b.store_id = c.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
......
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