Commit 655548f6 authored by zhuwei's avatar zhuwei

优化

parent 44a7656a
...@@ -27,11 +27,9 @@ class ImageDepotService ...@@ -27,11 +27,9 @@ class ImageDepotService
public function getImageWidthRand($img_type=0,$label='商场美食',$not_in_id) public function getImageWidthRand($img_type=0,$label='商场美食',$not_in_id)
{ {
$params_['img_status'] = 0; $params_['img_status'] = 0;
//$map['id']=array('not in','1,2,3');
if (!empty($not_in_id)) { if (!empty($not_in_id)) {
$params_['id'] = ['not in',$not_in_id]; $params_['id'] = ['not in',$not_in_id];
} }
$params_['img_type'] = $img_type; $params_['img_type'] = $img_type;
if($img_type == 0 or $img_type == 1) if($img_type == 0 or $img_type == 1)
{ {
...@@ -42,15 +40,11 @@ class ImageDepotService ...@@ -42,15 +40,11 @@ class ImageDepotService
} }
$result = $this->imageDepot->getImageDepotIDList($params_); $result = $this->imageDepot->getImageDepotIDList($params_);
if(!$result){ if(!$result){
//查询不到相关数据返回'' //查询不到相关数据返回''
return ''; return '';
} }
$random_keys=array_rand($result,1); $random_keys=array_rand($result,1);
//$img_file_path= CURRENT_URL . 'static/shop_image_depot/' . $result[$random_keys]['id'];
return $result[$random_keys]['id']; return $result[$random_keys]['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