|
@@ -506,12 +506,17 @@ class GoodsService
|
|
|
public static function selectCascaderList(Request $request)
|
|
|
{
|
|
|
$categoryIds = $request->get('category_id','');
|
|
|
- if (!$categoryIds){
|
|
|
+ $categorySuperId = $request->get('category_super_id','');
|
|
|
+ if (!$categoryIds && !$categorySuperId){
|
|
|
return json_fail('参数异常');
|
|
|
}
|
|
|
$data = [];
|
|
|
- $categorys = SysCategory::whereIn('category_id',$categoryIds)
|
|
|
- ->where('category_status','ACTIVED')
|
|
|
+ if (!empty($categoryIds)){
|
|
|
+ $categorys = SysCategory::whereIn('category_id',$categoryIds);
|
|
|
+ }else if(!empty($categorySuperId)){
|
|
|
+ $categorys = SysCategory::where('category_super_id',$categorySuperId);
|
|
|
+ }
|
|
|
+ $categorys = $categorys->where('category_status','ACTIVED')
|
|
|
->select('category_id as id','category_name as name','category_super_id as pid','category_super_path')
|
|
|
->orderBy('category_sort','DESC')
|
|
|
->get()
|