Commit d4b628d1 authored by hujun's avatar hujun

预约看铺

parent 25d4e315
......@@ -1332,8 +1332,8 @@ class Finance extends Basic
$insert_data[0]['create_time'] = date('Y-m-d H:i:s');
}
$m_bargain = new OBargainLogModel();
return $m_bargain->addLog($insert_data);
$m_bargain_log = new OBargainLogModel();
return $m_bargain_log->addLog($insert_data);
}
/**
......
......@@ -9,23 +9,26 @@
namespace app\index\controller;
use app\api\untils\GeTuiUntils;
use app\api_broker\service\PushMessageService;
use app\api_broker\service\ReportService;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\Agents;
use app\model\AppointWatchShop;
use app\model\AStore;
class WatchShop extends Basic
{
public function index(){
/**
* 预约看铺列表
*
* @return \think\Response|\think\response\View
*/
public function getList() {
if (!$this->request->isAjax()) {
return view('watch_shop/watch_list');
}
public function getList() {
$data['status'] = 200;
$data['msg'] = '';
......@@ -59,10 +62,32 @@ class WatchShop extends Basic
$where['house_title'] = ['like', $params['house_title'].'%'];
}
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 = [];
}
return $this->response($data['status'], $data['msg'], $data);
}
......
......@@ -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="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_id" placeholder="商铺编号" type="text" value="">
<!--增加商铺编号 搜索-->
<div class="clear"></div>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
......
......@@ -62,6 +62,49 @@ class AppointWatchShop extends BaseModel
->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', [
'loginVerify' => [ 'index/login/loginVerify', [ 'method' => 'post|get' ] ],
'logout' => [ 'index/login/logout', [ 'method' => 'get' ] ], //退出
//watchshop 预约看铺
'watch_shop' => [ 'index/WatchShop/index', [ 'method' => 'get' ] ],
'get_watch' => [ 'index/WatchShop/getList', [ 'method' => 'get' ] ],
'watch_shop/:type' => [ 'index/WatchShop/getList', [ 'method' => 'get' ], ['type' => 1] ],
'our_watch_shop/:type' => [ 'index/WatchShop/getList', [ 'method' => 'get' ], ['type' => 2] ],
'add_applies' => [ 'index/WatchShop/addApplies', [ 'method' => 'post' ] ],
//查询经纪人
......
......@@ -196,11 +196,12 @@ define (['doT', 'text!temp/watch_template_tpl.html', 'css!style/home.css','pagin
params.name = $("#name").val();
params.phone = $("#phone").val();
params.house_title = $("#house_title").val();
params.house_id = $("#house_id").val();
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
$.ajax ({
url: '/index/get_watch',
url: '/index/watch_shop/1',
type: 'GET',
async: true,
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