Commit 38188cd3 authored by hujun's avatar hujun

转铺列表展示

parent c227e542
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2017/12/20
* Time: 18:01
*/
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\SubletModel;
class Transfer extends Basic
{
/**
* 转铺列表
*
* @return \think\response\View
*/
public function index() {
return view('transfer/index');
}
/**
* 获取转铺列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getList() {
$data['status'] = 200;
$data['msg'] = '';
$params = $this->request->param();
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
// $where['status'] = 0;
$where = '';
// if (!empty($params['name'])) {
// $where['a.user_nick'] = ['like', '%'.$params['name'].'%'];
// }
$sublet = new SubletModel();
$fields = 'id,manage_type,address_detail,province,city,district,expected_rent,appellation,tel,create_time';
$data['list'] = $sublet->getSublet($pageNo, $pageSize, '', $fields, $where);
$data['total'] = $sublet->getSubletTotal($where);
return $this->response($data['status'], $data['msg'], $data);
}
}
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<a href="preview_list.html" class="active"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> 预约看铺列表</a> <a href="preview_list.html" class="active"><span class="glyphicon glyphicon-search" aria-hidden="true"></span> 预约看铺列表</a>
</li> </li>
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="entrust_list.html"> 委托转铺列表</a> <a href="transfer_list.html"> 委托转铺列表</a>
</li> </li>
<li role="presentation" class="active"> <li role="presentation" class="active">
<a href="users_list.html"> 用户列表</a> <a href="users_list.html"> 用户列表</a>
......
{layout name="global/frame_tpl" /} {layout name="global/frame_tpl" /}
<input type="hidden" class="page-load" id="home" /> <input type="hidden" class="page-load" id="transfer" />
<!--导航star--> <!--导航star-->
<!-- Sidebar --> <!-- Sidebar -->
...@@ -45,57 +45,29 @@ ...@@ -45,57 +45,29 @@
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody id="sublet_list" class="text-center">
</tbody>
<tbody> <tbody>
<tr>
<td>刘女士</td> <!--<tr>-->
<td>13545876</td> <!--<td>刘丹丹</td>-->
<td>刘丹丹</td> <!--<td>1254352</td>-->
<td>张大大</td> <!--<td>the Bird</td>-->
<td>刘丹丹</td> <!--<td>刘丹丹</td>-->
<td>张大大</td> <!--<td>张大大</td>-->
<td>Thornton</td> <!--<td>@twitter</td>-->
<td> <!--<td>Thornton</td>-->
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal"> <!--<td>-->
跟进 <!--<a class="btn1 btn-success " href="#modal-process" data-toggle="modal">-->
</a> <!--跟进-->
<a class="btn1 btn-warning " href="#modal-details" data-toggle="modal" onclick="show_details(2244)"> <!--</a>-->
转为上架商铺 <!--<a class="btn1 btn-danger" href="#modal-details" data-toggle="modal" onclick="show_details(2244)">-->
</a> <!--已转为上架商铺-->
</td> <!--</a>-->
</tr> <!--</td>-->
<tr>
<td>李楠楠</td>
<td>Jac12413ob</td>
<td>Thornton</td>
<td>刘丹丹</td>
<td>张大大</td>
<td>@fat</td>
<td>Thornton</td>
<td>
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal">
跟进
</a>
<a class="btn1 btn-warning " href="#modal-details" data-toggle="modal" onclick="show_details(2244)">
转为上架商铺
</a>
</td>
</tr>
<tr>
<td>刘丹丹</td>
<td>1254352</td>
<td>the Bird</td>
<td>刘丹丹</td>
<td>张大大</td>
<td>@twitter</td>
<td>Thornton</td>
<td>
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal">
跟进
</a>
<a class="btn1 btn-danger" href="#modal-details" data-toggle="modal" onclick="show_details(2244)">
已转为上架商铺
</a>
</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
......
...@@ -29,4 +29,38 @@ class SubletModel extends Model ...@@ -29,4 +29,38 @@ class SubletModel extends Model
} }
/**
* 查询转铺记录
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $fields
* @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 getSublet($pageNo = 1, $pageSize = 15, $order_ = '', $fields = '*', $params = '') {
$result = $this->field($fields)
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
return $result;
}
/**
* 查询转铺总记录数
*
* @param $params
* @return int|string
*/
public function getSubletTotal($params) {
$result = $this->where($params)->count();
return $result;
}
} }
...@@ -63,14 +63,16 @@ Route::group('index', [ ...@@ -63,14 +63,16 @@ Route::group('index', [
'addOrSave' => [ 'index/banner/addOrSave', [ 'method' => 'post' ] ], 'addOrSave' => [ 'index/banner/addOrSave', [ 'method' => 'post' ] ],
'upIsShow' => [ 'index/banner/upIsShow', [ 'method' => 'post' ] ], 'upIsShow' => [ 'index/banner/upIsShow', [ 'method' => 'post' ] ],
//user列表
'usersList' => ['index/member/getUserList',['method'=>'get']], 'usersList' => ['index/member/getUserList',['method'=>'get']],
'users_list' => ['index/member/index'], 'users_list' => ['index/member/index'],
'user_add' => ['index/member/user_add',['method'=>'post']], 'user_add' => ['index/member/user_add',['method'=>'post']],
'del_user' => ['index/member/delUser',['method'=>'post']], 'del_user' => ['index/member/delUser',['method'=>'post']],
//transfer转铺列表
'transfer_list' => ['index/transfer/index', ['method' => 'get']],
'get_transfer' => ['index/transfer/getlist', ['method' => 'get']],
//login //login
'login' => ['index/login/login',['method'=>'get']], 'login' => ['index/login/login',['method'=>'get']],
]); ]);
......
define (['doT', 'text!temp/transfer_template_tpl.html','ckfinder','ckfinderStart', 'css!style/home.css',"datetimepicker",'pagination','bootstrapJs'], function (doT, template) {
var user = {
pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/
urls: '',
init: function () {
//初始化dot
$ ("body").append (template);
user.getList ();
user.event ();
},
event: function () {
},
getList: function (pageNo) {
user.pageNo = pageNo;
var params = {};
params.pageNo = user.pageNo;
params.pageSize = user.pageSize;
$.ajax ({
url: '/index/get_transfer',
type: 'GET',
async: true,
data: params,
dataType: 'json',
success: function (data) {
var temp = document.getElementById ('transfer_list_tpl').innerHTML;
var doTtmpl = doT.template (temp);
$ ("#sublet_list").html (doTtmpl (data.data.list));
/*分页代码*/
$ ("#pagediv").pagination ({
length: data.data.total,
current: pageNo,
every: user.pageSize,
onClick: function (el) {
user.getList (el.num.current);
}
});
}
});
}
};
return user;
});
\ No newline at end of file
<script id="transfer_list_tpl" type="text/template">
[% if(it) { %]
[% for(var item in it){ %]
<tr>
<td>[%= it[item]["appellation"] %]</td>
<td>[%= it[item]["tel"] %]</td>
<td>[%= it[item]['manage_type'] %]</td>
<td>[%= it[item]["province"] %]-[%= it[item]["city"] %]-[%= it[item]["district"] %]</td>
<td>[%= it[item]["address_detail"] %]</td>
<td>[%= it[item]["expected_rent"] %]</td>
<td>[%= it[item]["create_time"] %]</td>
<td>
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal">跟进</a>
<a class="btn1 btn-danger" href="#modal-details" data-toggle="modal">已转为上架商铺</a></td>
</tr>
[% } %]
[% }else{ %]
<tr>
<td colspan="7" style="text-align:center;"> 暂无数据</td>
</tr>
[% } %]
</script>
\ 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