Commit 8c11f33f authored by luhongguang's avatar luhongguang

Merge branch 'jielong' of https://git.yidian-inc.com:8021/bp/goods into jielong

parents 935043b5 e88ff0f0
...@@ -21,7 +21,7 @@ class TakePlaceValidate extends \Validate\BaseValidate ...@@ -21,7 +21,7 @@ class TakePlaceValidate extends \Validate\BaseValidate
'city' => 'require', 'city' => 'require',
'area' => 'require', 'area' => 'require',
'offset' => 'egt:0', 'offset' => 'egt:0',
'limit' => 'elt:100', 'limit' => 'elt:1000',
]; ];
protected $message = [ protected $message = [
...@@ -35,7 +35,7 @@ class TakePlaceValidate extends \Validate\BaseValidate ...@@ -35,7 +35,7 @@ class TakePlaceValidate extends \Validate\BaseValidate
"city" => "市不能为空", "city" => "市不能为空",
"area" => "区不能为空", "area" => "区不能为空",
"offset" => "偏移量不能小于0", "offset" => "偏移量不能小于0",
"limit" => "单次不能大于100条", "limit" => "单次不能大于1000条",
]; ];
......
...@@ -118,14 +118,16 @@ class TakePlaceService ...@@ -118,14 +118,16 @@ class TakePlaceService
$where['ORDER'] = ['marketing_take_place_id' => 'DESC']; $where['ORDER'] = ['marketing_take_place_id' => 'DESC'];
$where['LIMIT'] = [$offset, $limit]; $where['LIMIT'] = [$offset, $limit];
// $e = MarketingTakePlace::debug();
$relations = MarketingTakePlace::select('*', $where); $relations = MarketingTakePlace::select('*', $where);
$makePlaceIds = array_column($relations,'take_place_id'); $makePlaceIds = array_column($relations,'take_place_id');
$where = ['take_place_id'=>$makePlaceIds,'is_delete'=>TakePlace::STATUS_NORMAL]; $where = ['take_place_id'=>$makePlaceIds,'is_delete'=>TakePlace::STATUS_NORMAL];
$takePlaces = TakePlace::select('*',$where);
return $takePlaces ?: []; $res['list'] = TakePlace::select('*',$where);
unset($where['ORDER'],$where['LIMIT']);
$res['total'] = TakePlace::count('*', $where);
return $res;
} }
} }
\ No newline at end of file
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