Commit d4b628d1 authored by hujun's avatar hujun

预约看铺

parent 25d4e315
...@@ -1332,8 +1332,8 @@ class Finance extends Basic ...@@ -1332,8 +1332,8 @@ class Finance extends Basic
$insert_data[0]['create_time'] = date('Y-m-d H:i:s'); $insert_data[0]['create_time'] = date('Y-m-d H:i:s');
} }
$m_bargain = new OBargainLogModel(); $m_bargain_log = new OBargainLogModel();
return $m_bargain->addLog($insert_data); return $m_bargain_log->addLog($insert_data);
} }
/** /**
......
...@@ -9,23 +9,26 @@ ...@@ -9,23 +9,26 @@
namespace app\index\controller; namespace app\index\controller;
use app\api\untils\GeTuiUntils;
use app\api_broker\service\PushMessageService; use app\api_broker\service\PushMessageService;
use app\api_broker\service\ReportService; use app\api_broker\service\ReportService;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\model\AAgents; use app\model\AAgents;
use app\model\Agents;
use app\model\AppointWatchShop; use app\model\AppointWatchShop;
use app\model\AStore;
class WatchShop extends Basic class WatchShop extends Basic
{ {
public function index(){ /**
return view('watch_shop/watch_list'); * 预约看铺列表
} *
* @return \think\Response|\think\response\View
*/
public function getList() { public function getList() {
if (!$this->request->isAjax()) {
return view('watch_shop/watch_list');
}
$data['status'] = 200; $data['status'] = 200;
$data['msg'] = ''; $data['msg'] = '';
...@@ -59,10 +62,32 @@ class WatchShop extends Basic ...@@ -59,10 +62,32 @@ class WatchShop extends Basic
$where['house_title'] = ['like', $params['house_title'].'%']; $where['house_title'] = ['like', $params['house_title'].'%'];
} }
$applies = new AppointWatchShop(); if (!empty($params['house_id'])) {
$where['house_id'] = $params['house_id'];
}
try {
$applies = new AppointWatchShop();
$data['list'] = [];
$data['total'] = 0;
if ($params['type'] == 1) {
$data['list'] = $applies->getAppointWatchShopList($pageNo, $pageSize, 'id DESC', '*', $where);
$data['total'] = $applies->getAppointWatchShopListTotal($where);
}
if ($params['type'] == 2) {
$data['list'] = $applies->getAppointWatchShopList($pageNo, $pageSize, 'id DESC', '*', $where);
$data['total'] = $applies->getAppointWatchShopListTotal($where);
}
} catch (\Exception $e) {
$data['status'] = 101;
$data['msg'] = '内部错误,请联系运营!' . $e->getMessage();
$data = [];
}
$data['list'] = $applies->getAppointWatchShopList($pageNo, $pageSize, 'id DESC', '*', $where);
$data['total'] = $applies->getAppointWatchShopListTotal($where);
return $this->response($data['status'], $data['msg'], $data); return $this->response($data['status'], $data['msg'], $data);
} }
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="name" placeholder="客户姓名" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="name" placeholder="客户姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="phone" placeholder="手机号" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="phone" placeholder="手机号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_title" placeholder="对外商铺名" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_title" placeholder="对外商铺名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="house_id" placeholder="商铺编号" type="text" value="">
<!--增加商铺编号 搜索--> <!--增加商铺编号 搜索-->
<div class="clear"></div> <div class="clear"></div>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
......
...@@ -62,6 +62,49 @@ class AppointWatchShop extends BaseModel ...@@ -62,6 +62,49 @@ class AppointWatchShop extends BaseModel
->select(); ->select();
} }
/**
* 查看自己的客户预约看铺
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAppointWatchOurList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params)
{
return $this
->field($field)
->alias('a')
->join('u_users b', 'a.user_id=b.id', 'left')
->join('a_agents c', 'b.id=c.agent_id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
/**
* 查看自己的客户预约看铺总数
*
* @param $params
* @return int|string
*/
public function getAppointWatchOurTotal($params)
{
return $this
->alias('a')
->join('u_users b', 'a.user_id=b.id', 'left')
->join('a_agents c', 'b.id=c.agent_id', 'left')
->where($params)
->count();
}
/** /**
* 预约看铺列表 已看列表 * 预约看铺列表 已看列表
* *
......
...@@ -90,8 +90,8 @@ Route::group('index', [ ...@@ -90,8 +90,8 @@ Route::group('index', [
'loginVerify' => [ 'index/login/loginVerify', [ 'method' => 'post|get' ] ], 'loginVerify' => [ 'index/login/loginVerify', [ 'method' => 'post|get' ] ],
'logout' => [ 'index/login/logout', [ 'method' => 'get' ] ], //退出 'logout' => [ 'index/login/logout', [ 'method' => 'get' ] ], //退出
//watchshop 预约看铺 //watchshop 预约看铺
'watch_shop' => [ 'index/WatchShop/index', [ 'method' => 'get' ] ], 'watch_shop/:type' => [ 'index/WatchShop/getList', [ 'method' => 'get' ], ['type' => 1] ],
'get_watch' => [ 'index/WatchShop/getList', [ 'method' => 'get' ] ], 'our_watch_shop/:type' => [ 'index/WatchShop/getList', [ 'method' => 'get' ], ['type' => 2] ],
'add_applies' => [ 'index/WatchShop/addApplies', [ 'method' => 'post' ] ], 'add_applies' => [ 'index/WatchShop/addApplies', [ 'method' => 'post' ] ],
//查询经纪人 //查询经纪人
......
...@@ -196,11 +196,12 @@ define (['doT', 'text!temp/watch_template_tpl.html', 'css!style/home.css','pagin ...@@ -196,11 +196,12 @@ define (['doT', 'text!temp/watch_template_tpl.html', 'css!style/home.css','pagin
params.name = $("#name").val(); params.name = $("#name").val();
params.phone = $("#phone").val(); params.phone = $("#phone").val();
params.house_title = $("#house_title").val(); params.house_title = $("#house_title").val();
params.house_id = $("#house_id").val();
params.pageNo = user.pageNo; params.pageNo = user.pageNo;
params.pageSize = user.pageSize; params.pageSize = user.pageSize;
$.ajax ({ $.ajax ({
url: '/index/get_watch', url: '/index/watch_shop/1',
type: 'GET', type: 'GET',
async: true, async: true,
data: params, data: params,
......
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