Commit 6e28c877 authored by zhuwei's avatar zhuwei

bug

parent 60d08ab9
......@@ -55,22 +55,28 @@ class ImageDepotService
*/
public function getImage($label='商场美食')
{
$return_arr = [];
$not_in_id = [];
//图片类型:0室外图 ,1室内图 ,2人群图
$indoor_img_id_ = $this->getImageWidthRand(0, $label);//图片类型:0室外图
if ($indoor_img_id_) {
$return_arr[] = $indoor_img_id_;
}
$indoor_img_id = $indoor_img_id_ ? $indoor_img_id_ : 1;
$outdoor_img_id_ = $this->getImageWidthRand(1, $label, $indoor_img_id);//图片类型:1室内图
$outdoor_img_id_ = $this->getImageWidthRand(1, $label, $indoor_img_id_);//图片类型:1室内图
if ($outdoor_img_id_) {
$return_arr[] = $outdoor_img_id_;
}
$outdoor_img_id = $outdoor_img_id_ ? $outdoor_img_id_ : 2;
/*组装字符串,用于排除已筛选出的ID start*/
if($indoor_img_id_){
$not_in_id[]=$indoor_img_id_;
}
if($outdoor_img_id_){
$not_in_id[]=$outdoor_img_id_;
}
/*组装字符串,用于排除已筛选出的ID end*/
$not_in_id = $indoor_img_id . ',' . $outdoor_img_id;
$people_img_id_ = $this->getImageWidthRand(2, $label, $not_in_id);//图片类型:2人群图
if ($people_img_id_) {
$return_arr[] = $people_img_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