Commit dfd5b894 authored by 吴贤德's avatar 吴贤德

Merge branch 'develop' of ssh://code.dev.soooner.com:50022/wuxiande/SooonerHotel into develop

parents 0ee5c5e9 fa36dab9
...@@ -16,11 +16,16 @@ class FrontAction extends CommonAction{ ...@@ -16,11 +16,16 @@ class FrontAction extends CommonAction{
echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}"; echo "{\"total\":\"".$total."\",\"rows\":".json_encode($list)."}";
}else{ }else{
$hotelModel = D("Hotel"); $hotelModel = D("Hotel");
$spModel = D("Sp");
if($userInfo['sp_ids']&&$userInfo['grade']>=3){ if($userInfo['sp_ids']&&$userInfo['grade']>=3){
$hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select(); $hotel_lists = $hotelModel->where("`status`=0 and sp_id in(".$userInfo['sp_ids'].")")->select();
$sp_lists = $spModel->where("`status`=0 and id in(".$userInfo['sp_ids'].")")->select();
}else{ }else{
$hotel_lists = $hotelModel->where("`status`=0")->select(); $hotel_lists = $hotelModel->where("`status`=0")->select();
$sp_lists = $spModel->where("`status`=0")->select();
} }
$this->sp_lists = $sp_lists;
$this->hotel_lists = $hotel_lists; $this->hotel_lists = $hotel_lists;
$this->display(); $this->display();
} }
......
...@@ -81,7 +81,7 @@ class SpAction extends CommonAction{ ...@@ -81,7 +81,7 @@ class SpAction extends CommonAction{
$id = $model->add($data); $id = $model->add($data);
if($conf){ if($conf&&$id){
$confData = array(); $confData = array();
foreach($conf as $key => $value){ foreach($conf as $key => $value){
$confData[] = array("sp_id"=>$id,"type_code"=>$key,"name"=>$data['name'].key($value),"v"=>$value[key($value)],"addtime"=>date('Y-m-d H:i:s')); $confData[] = array("sp_id"=>$id,"type_code"=>$key,"name"=>$data['name'].key($value),"v"=>$value[key($value)],"addtime"=>date('Y-m-d H:i:s'));
......
...@@ -13,11 +13,14 @@ class FrontModel extends RelationModel{ ...@@ -13,11 +13,14 @@ class FrontModel extends RelationModel{
$searchField = $inputs["searchField"]?$inputs["searchField"]:'A.name'; $searchField = $inputs["searchField"]?$inputs["searchField"]:'A.name';
$searchValue = $inputs["searchValue"]?$inputs["searchValue"]:''; $searchValue = $inputs["searchValue"]?$inputs["searchValue"]:'';
$searchHotel = $inputs["searchHotel"]?$inputs["searchHotel"]:0; $searchHotel = $inputs["searchHotel"]?$inputs["searchHotel"]:0;
$searchSp = $inputs["searchSp"]?$inputs["searchSp"]:0;
if($searchValue){ if($searchValue){
$where = " and (A.`name` like '%".$searchValue."%' or A.`code` like '%".$searchValue."%') "; $where = " and (A.`name` like '%".$searchValue."%' or A.`code` like '%".$searchValue."%') ";
} }
if($searchSp){
$where .= " and B.sp_id = $searchSp ";
}
if($searchHotel){ if($searchHotel){
$where .= " and A.hotel_id = $searchHotel "; $where .= " and A.hotel_id = $searchHotel ";
} }
...@@ -33,9 +36,9 @@ class FrontModel extends RelationModel{ ...@@ -33,9 +36,9 @@ class FrontModel extends RelationModel{
//返回列表(limit分页) //返回列表(limit分页)
if($queryType=="list"){ if($queryType=="list"){
$where .= $sort." ".$limit; $where .= $sort." ".$limit;
$fields = " A.*,B.`name` hotel_name,case A.`status` when 2 then '<font color=red>删除</font>' when 1 then '<font color=red>禁用</font>' when 0 then '<font color=green>启用</font>' end as `status` "; $fields = " A.*,B.`name` hotel_name,C.`name` sp_name,case A.`status` when 2 then '<font color=red>删除</font>' when 1 then '<font color=red>禁用</font>' when 0 then '<font color=green>启用</font>' end as `status` ";
} }
$sql = "select ".$fields." from sh_hotel_device A join sh_hotel B on A.hotel_id = B.id where 1=1 ".$where.";"; $sql = "select ".$fields." from sh_hotel_device A join sh_hotel B on A.hotel_id = B.id join sh_sp C on B.sp_id = C.id where 1=1 ".$where.";";
return $model->query($sql); return $model->query($sql);
} }
} }
\ No newline at end of file
...@@ -24,6 +24,12 @@ ...@@ -24,6 +24,12 @@
<form name="searchform" method="post" action="" id ="searchform"> <form name="searchform" method="post" action="" id ="searchform">
<input type="hidden" name="op" value="getjson"> <input type="hidden" name="op" value="getjson">
<div class="inputBox"> <div class="inputBox">
<select class="select" name="searchSp">
<option value="0">合作方</option>
<volist name="sp_lists" id="item">
<option value="{$item.id}">{$item.name}</option>
</volist>
</select>
<select class="select" name="searchHotel"> <select class="select" name="searchHotel">
<option value="0">酒店</option> <option value="0">酒店</option>
<volist name="hotel_lists" id="item"> <volist name="hotel_lists" id="item">
...@@ -66,6 +72,7 @@ onRowContextMenu : onRowContextMenu ...@@ -66,6 +72,7 @@ onRowContextMenu : onRowContextMenu
<thead> <thead>
<tr> <tr>
<th data-options="field:'hotel_name',width:40" sortable="true">酒店</th> <th data-options="field:'hotel_name',width:40" sortable="true">酒店</th>
<th data-options="field:'sp_name',width:40" sortable="true">合作方</th>
<th data-options="field:'type',width:20" formatter="TypeAction">类型</th> <th data-options="field:'type',width:20" formatter="TypeAction">类型</th>
<th data-options="field:'name',width:40">分前端名称</th> <th data-options="field:'name',width:40">分前端名称</th>
<th data-options="field:'code',width:20">分前端标识</th> <th data-options="field:'code',width:20">分前端标识</th>
......
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