|
@@ -25,8 +25,8 @@ class OrderCategory extends Model{
|
|
"spuCode"=>$value['spuCode'],
|
|
"spuCode"=>$value['spuCode'],
|
|
"cat_code"=>$value['cat_code'],
|
|
"cat_code"=>$value['cat_code'],
|
|
"cat_name"=>$value['cat_name'],
|
|
"cat_name"=>$value['cat_name'],
|
|
- "short_name"=>$value['short_name'],
|
|
|
|
- "merge_code"=>$value['merge_code'],
|
|
|
|
|
|
+ "short_name"=>$value['short_name']??"",
|
|
|
|
+ "merge_code"=>$value['merge_code']??"",
|
|
"tax"=>$value['tax'],
|
|
"tax"=>$value['tax'],
|
|
"inv_good_name"=>$value['inv_good_name']
|
|
"inv_good_name"=>$value['inv_good_name']
|
|
];
|
|
];
|
|
@@ -43,9 +43,12 @@ class OrderCategory extends Model{
|
|
$info=self::with(['GoodInfo'])->where(["code"=>$code])->field(["code","spuCode","cat_code","cat_name","tax","inv_good_name"])->select();
|
|
$info=self::with(['GoodInfo'])->where(["code"=>$code])->field(["code","spuCode","cat_code","cat_name","tax","inv_good_name"])->select();
|
|
$temp=[];
|
|
$temp=[];
|
|
if(!empty($info)){
|
|
if(!empty($info)){
|
|
- foreach ($info as $value){
|
|
|
|
- $temp[$value['code']][]=$value;
|
|
|
|
- }
|
|
|
|
|
|
+ if (is_array($code)){
|
|
|
|
+ foreach ($info as $value){
|
|
|
|
+ $temp[$value['code']][]=$value;
|
|
|
|
+ }
|
|
|
|
+ }else $temp= $info->toArray();
|
|
|
|
+
|
|
}
|
|
}
|
|
return $temp;
|
|
return $temp;
|
|
}
|
|
}
|