Commit 062c9838 authored by hujun's avatar hujun

位置调整

parent 16207c35
......@@ -942,6 +942,20 @@ class GHouses extends BaseModel
$params['internal_title'] = trim($params['internal_title']);
}
if ($params['image_file']) {
$m_img = new GHousesImgs();
$image_file = json_decode($params['image_file'], true);
$img_data = [];
foreach ($image_file as $k=>$v) {
$img_data[$k]['house_id'] = $this->id;
$img_data[$k]['img_name'] = $v['img_name'];
$img_data[$k]['img_type'] = $v['img_type'];
}
$m_img->addHouseImgAll($img_data);
}
//新增或编辑
if (empty($params['id'])) {
$params['upload_id'] = $agent_id;
......@@ -949,21 +963,6 @@ class GHouses extends BaseModel
$house_id = $this->id;
$result['house_id'] = $this->id;
$result['internal_title'] = $params['internal_title'];
if ($params['image_file']) {
$m_img = new GHousesImgs();
$image_file = json_decode($params['image_file'], true);
$img_data = [];
foreach ($image_file as $k=>$v) {
$img_data[$k]['house_id'] = $this->id;
$img_data[$k]['img_name'] = $v['img_name'];
$img_data[$k]['img_type'] = $v['img_type'];
}
$m_img->addHouseImgAll($img_data);
}
} else {
$house_data = $this->field('id,internal_title,residue_num,total')->where('id', $params['id'])->where('status', '<>', 3)->find();
if (!empty($house_data['id'])) {
......
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