Commit 1dd55750 authored by hujun's avatar hujun

商铺列表修改

parent d21d2569
...@@ -163,11 +163,6 @@ class GHouses extends BaseModel ...@@ -163,11 +163,6 @@ class GHouses extends BaseModel
->select(); ->select();
$house_id = array(); $house_id = array();
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
if ($v['upload_id'] == $agents_id) {
$data[$k]['auth_edit_house'] = 1;
} else {
$data[$k]['auth_edit_house'] = 0;
}
$house_id[$k] = $v['id']; $house_id[$k] = $v['id'];
$v->create_time = date('Y-m-d', strtotime($v->create_time)); $v->create_time = date('Y-m-d', strtotime($v->create_time));
} }
...@@ -176,15 +171,18 @@ class GHouses extends BaseModel ...@@ -176,15 +171,18 @@ class GHouses extends BaseModel
if (empty($house_id)) { if (empty($house_id)) {
$result = $data; $result = $data;
} else { } else {
$house_id = array_unique($house_id);
/*案场权限人和盘方*/ /*案场权限人和盘方*/
$house_agents = Db::table('g_houses_to_agents')->alias('a') $house_agents = Db::table('g_houses_to_agents')->alias('a')
->field('a.houses_id,b.id,b.name,b.phone,a.type') ->field('a.houses_id,b.id,b.name,b.phone,a.type')
->join('a_agents b', 'a.agents_id=b.id', 'left') ->join('a_agents b', 'a.agents_id=b.id', 'left')
->where('a.houses_id', 'IN', implode(',', $house_id)) ->where('a.houses_id', 'IN', implode(',', $house_id))
->where('a.is_del', 0) ->where('a.is_del', 0)
->where('a.type',2)
->select(); ->select();
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
if ($v['upload_id'] == $agents_id) { if ($v['upload_id'] == $agents_id) {
$data[$k]['auth_edit_house'] = 1; $data[$k]['auth_edit_house'] = 1;
} else { } else {
...@@ -194,13 +192,9 @@ class GHouses extends BaseModel ...@@ -194,13 +192,9 @@ class GHouses extends BaseModel
$dish_name = ''; $dish_name = '';
$result[$k]['dish_name'] = ''; $result[$k]['dish_name'] = '';
foreach ($house_agents as $k2 => $v2) { foreach ($house_agents as $k2 => $v2) {
if ($v->id == $v2['houses_id']) { if ($v['id'] == $v2['houses_id']) {
if ($v2['type'] == 2) {
$dish_name .= $v2['name'] . ','; $dish_name .= $v2['name'] . ',';
$result[$k]['dish_name'] = rtrim($dish_name, ','); $result[$k]['dish_name'] = rtrim($dish_name, ',');
} else {
$result[$k]['dish_name'] = '';
}
} }
} }
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
[% } %] [% } %]
</td> </td>
<td> <td>
[% if(check_auth('index/houseEdit')) { %] [% if(it[item]['auth_edit_house'] || check_auth('index/houseEdit')) { %]
<a class="btn1 btn-success " href="/admin.php/index/houseEdit?id=[%= it[item]['id']%]" data-toggle="modal" >编辑</a> <a class="btn1 btn-success " href="/admin.php/index/houseEdit?id=[%= it[item]['id']%]" data-toggle="modal" >编辑</a>
[% } %] [% } %]
......
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