Commit 16207c35 authored by hujun's avatar hujun

图片批量处理

parent 7de79284
......@@ -953,9 +953,15 @@ class GHouses extends BaseModel
if ($params['image_file']) {
$m_img = new GHousesImgs();
$image_file = json_decode($params['image_file'], true);
$img_data = [];
foreach ($image_file as $k=>$v) {
$m_img->addHouseImg($v,$this->id);
$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 {
......
......@@ -219,6 +219,17 @@ class GHousesImgs extends BaseModel
]);
}
/**
* 批量添加楼盘图片
*
* @param array $data
* @return array|false
* @throws \Exception
*/
public function addHouseImgAll($data = []) {
return $this->saveAll($data);
}
/**
* 独家图片新增和编辑
*
......
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