Commit 01e207c7 authored by zhuwei's avatar zhuwei

监督执行列表

parent bf955475
......@@ -11,9 +11,19 @@ namespace app\index\controller;
use app\index\extend\Basic;
use app\model\AgentsVisitors;
use app\model\ASuperviseModel;
class Supervise extends Basic
{
protected $aSuperviseModel;
public function __construct($request = null)
{
parent::__construct($request);
$this->aSuperviseModel = new ASuperviseModel();
}
/**
* 门店拜访
*
......@@ -136,4 +146,68 @@ class Supervise extends Basic
return view('carryOut');
}
}
/**
* 监督执行列表
* User: 朱伟
* Date: 2018/6/14
* Time: 14:10:15
*/
public function superviseList(){
if (!$this->request->isAjax()) {
return view('supervise/supervise_list');
}
$result = '';
$params = $this->params;
$checkResult = $this->validate($params, "VerifyValidate.select");
if (true !== $checkResult) {
//return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
//搜索条件 start
//1.上传时间
if (!empty($params['create_time_start']) && !empty($params['create_time_end'])) {
$where['a.create_time'] = ['between time', [$params['create_time_start']. ' 00:00:00', $params['create_time_end'] . ' 23:59:59']];
}
//2.部门
if (!empty($params['district_id'])) {
$where['b.district_id'] = $params['district_id'];
}
//3.门店名称
if (!empty($params['store_id'])) {
$where['b.store_id'] = $params['store_id'];
}
//4.提交人手机号
if (!empty($params['phone'])) {
$where['b.phone'] = ['LIKE','%'.$params['phone'].'%'];
}
//5.跟进内容
if (!empty($params['remark'])) {
$where['a.remark'] = ['LIKE','%'.$params['remark'].'%'];
}
//搜索条件 end
$fields_evaluate = 'a.create_time,a.agent_name,a.address,a.img as supervise_img,a.remark,b.name,b.phone,c.store_name';
$data['list'] = $this->aSuperviseModel->findSuperviseList($pageNo, $pageSize, 'a.id desc', $fields_evaluate, $where);
$data['total'] = $this->aSuperviseModel->findSuperviseListCount($fields_evaluate, $where);
foreach ($data['list'] as $k=>$v) {
$data['list'][$k]['supervise_img'] = CK_IMG_URL .'images/supervise/' . $v['supervise_img'];
}
//var_dump($result);
//return $result;
return $this->response(200, 'success', $data);
}
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titlesupervise_list</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
<?php
namespace app\model;
use think\Db;
use think\Model;
/**
* Created by PhpStorm.
* User : zhuwei
* Date : 2018-06-14
* Time : 14:26:58
* Intro:
*/
class ASuperviseModel extends Model
{
protected $table = "a_supervise";
private $db_model;
function __construct()
{
$this->db_model = Db::name($this->table);
}
public function findSuperviseList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params = '') {
$result = $this
->field($field)
->alias('a')
->join('a_agents b', 'a.agent_id = b.id', 'left')
->join('a_store c', 'b.store_id = c.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
return $result;
}
public function findSuperviseListCount($field, $params = '') {
$result = $this
->field($field)
->alias('a')
->join('a_agents b', 'a.agent_id = b.id', 'left')
->join('a_store c', 'b.store_id = c.id', 'left')
->where($params)
->count();
return $result;
}
}
\ No newline at end of file
......@@ -244,8 +244,14 @@ Route::group('index', [
'test' => ['index/WxTest/test', [ 'method' => 'POST|GET' ] ], //wx
'evaluationList' => [ 'index/Evaluation/evaluationList', [ 'method' => 'POST|GET' ] ], //评价列表 朱伟 2018-06-13
'marchInList' => [ 'index/MarchIn/marchInList', [ 'method' => 'POST|GET' ] ], //进场记录列表 朱伟 2018-06-13
'superviseList' => [ 'index/Supervise/superviseList', [ 'method' => 'POST|GET' ] ], //监督执行列表 朱伟 2018-06-14
]);
......
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