Commit 399e0b98 authored by hujun's avatar hujun

约带看

parent 0c1d0966
<?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\AAgents;
use app\model\OfficeOReportModel;
use app\model\OReportModel;
class OfficeReport extends Basic
{
/**
* 获取报备列表 pc
*
* @return \think\Response
*/
public function inspectionRecordAll()
{
if (!$this->request->isAjax()) {
return view('office_report/reportList');
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$m_report = new OfficeOReportModel();
$m_agent = new AAgents();
switch ($this->params['check_status']) {
case 0 :
$where['a.report_agent_id'] = $this->userId;
break;
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['msg'] = "";
$where["a.status"] = 0;
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['e.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'];
}
if (!empty($this->params['order_id'])) {
$where['b.id'] = $this->params['order_id'];
}
//城市
if (!empty($this->params['city'])) {
$where['e.city'] = $this->params['city'];
}
//商铺地址
if (!empty($this->params['internal_address'])) {
$where['e.address'] = ['like', '%' . $this->params['internal_address'] . '%'];
}
//商铺ID
if (!empty($this->params['shop_id'])) {
$where['c.id'] = $this->params['shop_id'] ;
}
//客户ID
if (!empty($this->params['user_id'])) {
$where['a.user_id'] = $this->params['user_id'] ;
}
$field = 'b.id as order_id,a.user_name,a.user_phone,a.create_time,a.report_agent_name,e.title as house_title,a.predict_see_time';
$field .= ',a.id,b.order_no';
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
...@@ -88,7 +88,7 @@ class Report extends Basic ...@@ -88,7 +88,7 @@ class Report extends Basic
//商铺地址 //商铺地址
if (!empty($this->params['internal_address'])) { if (!empty($this->params['internal_address'])) {
$where['c.internal_address'] = ['like', '%' . $this->params['internal_address'] . '%']; $where['e.address'] = ['like', '%' . $this->params['internal_address'] . '%'];
} }
//商铺ID //商铺ID
......
This diff is collapsed.
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="userEntrusted" />
<style>
.modal-body {
/*height: 600px;*/
overflow-y: auto;
}
.user-ul2 {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
}
.user-ul2 li {
list-style: none;
line-height: 30px;
}
.money_total_two {
font-weight: bold;
font-size: 15px;
}
#search {
float: left;
}
#reset {
float: left;
}
#district_id {
width: 16%!important;
}
.clear{
clear: both;
}
.modal-body-intention{
width: 900px!important;
}
.modal-body-intention tr{
height: 36px;
}
.modal-body-intention input,.modal-body-intention select{
height: 28px;
border: 1px solid #e0e0e0;
outline-style: none;
width: 200px;
}
.span-width-90{
width: 90px;
display: inline-block;
}
.tip-liu{
font-size: 15px;
}
/*上传图片相关*/
.span-del2-du,.span-del-du{
color: red;
cursor: pointer;
}
.modal-body-height {
overflow-y: auto;
height: 432px;
}
#container_body_img_area>div{
float: left;
width: 172px;
}
.img-pre-ul {
padding-left: 0;
overflow: hidden;
}
.img-pre-ul>li {
list-style: no;
float: left;
width: 210px;
height: 170px;
overflow: hidden;
margin-right: 10px;
margin-top: 10px;
}
.img-pre-ul>li>img {
float: left;
width: 210px;
height: 140px;
object-fit: contain;
cursor: pointer;
}
.img-pre-ul>li>a {
float: left;
width: 210px;
text-align: center;
line-height: 30px;
}
#container_body_du{
position: relative;
overflow: hidden;
}
#file_input_pic {
opacity: 0;
position: absolute;
top: 0;
left: 145px;
height: 35px;
width: 80px;
}
.result-du{
text-align: center;
width: 150px;
float: left;
margin-right: 10px;
}
.result-du img{
width: 150px;
height: 150px;
}
/*上传图片相关*/
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li>
<a href="javascript:;">客户委托找铺</a>
</li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<!--同步app-->
<tr>
<td colspan="14" class="maintable-top-sub-tr">
<a class="btn btn-info liudan_pic_btn" id="our">我的</a>
<!--<a class="btn btn-default liudan_pic_btn" id="is_show_store">门店</a>
<a class="btn btn-default liudan_pic_btn" id="is_show_district">部门</a>-->
<a class="btn btn-default liudan_pic_btn" id="is_show_all">全部</a>
</td>
</tr>
<tr>
<td colspan="10">
<form id="form_search">
<span class="fore-span ld-Marheight">提交时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_start" name="start_date1" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="create_time_end" name="end_date1" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_ID" placeholder="客户ID" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_phone" placeholder="客户手机号" type="text" value="">
<select name="" id="is_kefang" class="form-control btn2 ld-Marheight">
<option value="0">是否有客方</option>
<option value="1"></option>
<option value="2"></option>
</select>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
</form>
</td>
</tr>
<tr>
<th class="text-center">提交时间</th>
<th class="text-center">客户ID</th>
<th class="text-center">昵称</th>
<th class="text-center">手机号</th>
<th class="text-center">期望区域</th>
<th class="text-center">计划经营</th>
<th class="text-center">面积要求(m²)</th>
<th class="text-center">租金预算</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="text-center" id="follow_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--客户详情 跟进-->
<div class="modal fade" id="modal-record" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" data-backdrop="static">
<div class="modal-dialog modal-body-details" style="width: 900px;">
<div class="modal-content">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="display: none;">
×
</button>
<iframe style="width: 100%;height: 756px;display: block;border: none;border-radius: 6px;"></iframe>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
...@@ -744,6 +744,48 @@ class OfficeOReportModel extends Model ...@@ -744,6 +744,48 @@ class OfficeOReportModel extends Model
->select(); ->select();
} }
/**
* @param int $pageNo 7151
* @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 = '')
{
$result = $this->db->field($field)
->alias("a")
->join("a_agents d", "a.report_agent_id = d.id", "left")
->join("o_order b", "a.id = b.f_id", "left")
->join("office_g_room c", "b.house_id = c.id", "left")
->join("office_g_building e", "c.building_id = e.id", "left")
->where($params)
->limit($pageSize)
->page($pageNo)
->order($order_)
->select();
return $result;
}
/**
* @param string $params
* @return int|string
*/
public function getAddReportListTotal($params = '')
{
$result = $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("office_g_room c", "b.house_id = c.id", "left")
->join("office_g_building e", "c.building_id = e.id", "left")
->where($params)
->count('a.id');
return $result;
}
} }
......
...@@ -1052,7 +1052,10 @@ Route::group('office_index', [ ...@@ -1052,7 +1052,10 @@ Route::group('office_index', [
'bargainInfo' => ['index/officePayLog/bargainInfo', ['method' => 'GET']],//成交报告详情 'bargainInfo' => ['index/officePayLog/bargainInfo', ['method' => 'GET']],//成交报告详情
'commissionList' => ['index/officePayLog/commissionList', ['method' => 'GET']],//成交报告分佣提成 'commissionList' => ['index/officePayLog/commissionList', ['method' => 'GET']],//成交报告分佣提成
'getTallAge' => ['index/officePayLog/getTallAgeV2', ['method' => 'GET']],//成交报告分佣提成 'getTallAge' => ['index/officePayLog/getTallAgeV2', ['method' => 'GET']],//成交报告分佣提成
'inspectionRecordOur/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 0]], //我的约带看
'inspectionRecordStore/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 1]], //门店约带看
'inspectionRecordDistrict/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 2]], //部门约带看
'inspectionRecordAll/:check_status' => ['index/OfficeReport/inspectionRecordAll', ['method' => 'GET'], ['check_status' => 3]], //全部约带看
]); ]);
Route::group('office_api', [ Route::group('office_api', [
......
...@@ -186,7 +186,7 @@ define(['doT', 'text!temp/inspectionRecordAllOffice_list_template_tpl.html', 'cs ...@@ -186,7 +186,7 @@ define(['doT', 'text!temp/inspectionRecordAllOffice_list_template_tpl.html', 'cs
record.submitIntention(); record.submitIntention();
}); });
if (!check_auth('index/inspectionRecordStore/1')) { if (!check_auth('office_index/inspectionRecordStore/1')) {
$("#is_show_store").hide(); $("#is_show_store").hide();
} }
...@@ -198,27 +198,27 @@ define(['doT', 'text!temp/inspectionRecordAllOffice_list_template_tpl.html', 'cs ...@@ -198,27 +198,27 @@ define(['doT', 'text!temp/inspectionRecordAllOffice_list_template_tpl.html', 'cs
$("#is_show_all").hide(); $("#is_show_all").hide();
} }
$("#our").click(function () { $("#our").click(function () {
record.url = "/broker/reportListForPc"; record.url = "/office/reportListForPc";
}); });
$("#is_show_store").click(function () { $("#is_show_store").click(function () {
record.url = "/index/inspectionRecordStore/1"; record.url = "/office_index/inspectionRecordStore/1";
}); });
$("#is_show_district").click(function () { $("#is_show_district").click(function () {
record.url = "/index/inspectionRecordDistrict/2"; record.url = "/office_index/inspectionRecordDistrict/2";
}); });
$("#is_show_all").click(function () { $("#is_show_all").click(function () {
record.url = "/index/inspectionRecordAll/3"; record.url = "/office_index/inspectionRecordAll/3";
}); });
}, },
//获取一级审核,二级审核,三级审核,结单不同的ajax请求url //获取一级审核,二级审核,三级审核,结单不同的ajax请求url
switchUrl: function(){ switchUrl: function(){
switch (Number(this.mainTabIndex)){ switch (Number(this.mainTabIndex)){
case 0: case 0:
return '/index/inspectionRecordAll/3'; return '/office_index/inspectionRecordAll/3';
case 1: case 1:
return '/index/inspectionRecordDistrict/2'; return '/office_index/inspectionRecordDistrict/2';
case 2: case 2:
return '/index/inspectionRecordStore/1'; return '/office_index/inspectionRecordStore/1';
default: default:
return ''; return '';
} }
......
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