Commit f2e4603b authored by zw's avatar zw

Merge remote-tracking branch 'origin/1030-v2.9.6' into 1030-v2.9.6

parents 14b9f474 572e994c
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/10/31
* Time: 9:54
*/
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\OReportModel;
class Report extends Basic
{
/**
* 获取报备列表 pc
*
* @return \think\Response
*/
public function inspectionRecordAll()
{
if (!$this->request->isAjax()) {
return view('reportList');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$m_report = new OReportModel();
$data['code'] = 200;
$data['msg'] = "";
$where = [];
if (!empty($this->params['start_time']) && empty($this->params['end_time'])) {
$where['a.create_time'] = ['> time', $this->params['start_time'] . ' 00:00:00'];
}
if (!empty($this->params['end_time']) && empty($this->params['start_time'])) {
$where['a.create_time'] = ['< time', $this->params['end_time'] . ' 23:59:59'];
}
if (!empty($this->params['end_time']) && !empty($this->params['start_time'])) {
$where['a.create_time'] = ['between time', [$this->params['start_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59']];
}
if (!empty($this->params['user_phone'])) {
$where['a.user_phone'] = $this->params['user_phone'];
}
if (!empty($this->params['internal_title'])) {
$where['c.internal_title'] = $this->params['internal_title'];
}
if (!empty($this->params['report_agent_name'])) {
$where['a.report_agent_name'] = $this->params['report_agent_name'];
}
if (!empty($this->params['report_agent_phone'])) {
$where['a.report_agent_phone'] = $this->params['report_agent_phone'];
}
$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';
try {
$list = $m_report->getReportList($pageNo, $pageSize, 'a.id desc', $field, $where);
$data['data']['total'] = $m_report->getAddReportListTotal($where);
$data['data']['list'] = $list;
} catch (\Exception $e) {
$data['code'] = 101;
$data['code'] = '内部错误:' . $e->getMessage();
}
return $this->response($data['code'], $data['msg'], $data['data']);
}
}
\ No newline at end of file
...@@ -600,7 +600,6 @@ class OReportModel extends Model ...@@ -600,7 +600,6 @@ class OReportModel extends Model
return $result; return $result;
} }
/** /**
* @param $params * @param $params
* @param $field * @param $field
...@@ -634,6 +633,92 @@ class OReportModel extends Model ...@@ -634,6 +633,92 @@ class OReportModel extends Model
return $result; return $result;
} }
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getReportList($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '')
{
$where_ = [];
if (isset($params["agent_id"])) {
$where_["a.report_agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["a.create_time"] = $params["create_time"];
}
if (isset($params["house_ids"])) {
$where_["b.house_id"] = array( "in", $params["house_ids"] );
}
if (isset($params['report_agent_name'])) {
$where_["a.report_agent_name"] = $params['report_agent_name'];
}
if (isset($params['report_agent_phone'])) {
$where_["a.report_agent_phone"] = $params['report_agent_phone'];
}
if (isset($params['internal_title'])) {
$where_["c.internal_title"] = $params['internal_title'];
}
if (isset($params['user_phone'])) {
$where_["a.user_phone"] = $params['user_phone'];
}
$where_["a.status"] = 0;
$result = $this->db->field($field)
->alias("a")
->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left")
->where($where_)
->limit($pageSize)
->page($pageNo)
->order($order_)
->select();
return $result;
}
/**
* 约带看总数
*
* @param $params
* @return int|string
*/
public function getAddReportListTotal($params)
{
$where_["a.status"] = 0;
if (isset($params["agent_id"])) {
$where_["a.report_agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["a.create_time"] = $params["create_time"];
}
if (isset($params["house_ids"])) {
$where_["b.house_id"] = array("in", $params["house_ids"]);
}
if (isset($params['report_agent_name'])) {
$where_["a.report_agent_name"] = $params['report_agent_name'];
}
if (isset($params['report_agent_phone'])) {
$where_["a.report_agent_phone"] = $params['report_agent_phone'];
}
if (isset($params['internal_title'])) {
$where_["c.internal_title"] = $params['internal_title'];
}
if (isset($params['user_phone'])) {
$where_["a.user_phone"] = $params['user_phone'];
}
return $this->db->alias("a")
->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left")
->where($where_)
->count('a.id');
}
public function getAddReportListPcInfo($params, $field, $page_no, $page_size) public function getAddReportListPcInfo($params, $field, $page_no, $page_size)
{ {
$where_ = []; $where_ = [];
......
...@@ -343,6 +343,7 @@ Route::group('index', [ ...@@ -343,6 +343,7 @@ 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' => [ 'index/Site/delImageDepot', [ 'method' => 'POST|GET' ] ], //关闭或开启站点 朱伟 2018-10-18 'delImageDepot' => [ 'index/Site/delImageDepot', [ 'method' => 'POST|GET' ] ], //关闭或开启站点 朱伟 2018-10-18
'inspectionRecordAll' => [ 'index/report/inspectionRecordAll', [ 'method' => 'GET' ] ], //全部约带看
]); ]);
......
...@@ -722,3 +722,20 @@ p{margin: 0;} ...@@ -722,3 +722,20 @@ p{margin: 0;}
#preview_big_img_div>img{ #preview_big_img_div>img{
max-height: 98%; max-height: 98%;
} }
.mark {
display: none;
position: fixed;
top: 20%;
right: 0;
/*bottom: 0;*/
left: 0;
margin: auto;
height: 0.88rem;
line-height: 0.88rem;
width: 40%;
text-align: center;
font-size: 0.28rem;
color: #fff;
background: rgba(0, 0, 0, 0.6);
border-radius: 0.1rem;
}
\ No newline at end of file
...@@ -301,3 +301,14 @@ function urlDeal(urlStr, httpStr) { ...@@ -301,3 +301,14 @@ function urlDeal(urlStr, httpStr) {
function dealPunctuation(str) { function dealPunctuation(str) {
return str.replace(/!!!!!/g, '').replace(/!!!!!/g, '').replace(/\?\?\?\?\?/g, '').replace(/?????/g, '').replace(/。。。。。/g, ''); return str.replace(/!!!!!/g, '').replace(/!!!!!/g, '').replace(/\?\?\?\?\?/g, '').replace(/?????/g, '').replace(/。。。。。/g, '');
} }
function alert(str) {
var div = '<div class="mark"></div>';
$('body').append(div)
$('.mark').html(str);
$('.mark').show();
setTimeout(function() {
$('.mark').hide();
$('.mark').remove();
}, 2000000)
}
\ No newline at end of file
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