Commit 84b65352 authored by hujun's avatar hujun

盘方名

parent 4dcd760b
...@@ -143,17 +143,14 @@ class GHouses extends BaseModel ...@@ -143,17 +143,14 @@ class GHouses extends BaseModel
foreach ($data as $k=>$v) { foreach ($data as $k=>$v) {
$result[$k] = $v->toArray(); $result[$k] = $v->toArray();
$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'] == 0) { if ($v2['type'] == 2) {
$result[$k]['agents_name'][$k2]['id'] = $v2['id']; $dish_name .= $v2['name'].',';
$result[$k]['agents_name'][$k2]['name'] = $v2['name']; $result[$k]['dish_name'] = rtrim($dish_name,',');
$result[$k]['agents_name'][$k2]['phone'] = $v2['phone']; } else {
} $result[$k]['dish_name'] = '';
if ($v2['type'] == 1) {
$result[$k]['dish_name'][$k2]['id'] = $v2['id'];
$result[$k]['dish_name'][$k2]['name'] = $v2['name'];
$result[$k]['dish_name'][$k2]['phone'] = $v2['phone'];
} }
} }
} }
......
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