|
@@ -1032,10 +1032,17 @@ class Purchin extends Base
|
|
|
$page = $page >= $total ? $total : $page;
|
|
|
$list = Db::name('purchease_return')->alias('a')->join("purchease_order b","b.cgdNo=a.cgdNo","left")
|
|
|
->where($where)->page($page,$size)
|
|
|
- ->field("a.*,b.spuCode,b.good_price,b.total_fee,b.good_name")->order("a.addtime desc")->select();
|
|
|
+ ->field("a.*,b.spuCode,b.good_price,b.order_type,b.good_price,b.total_fee,b.good_name")->order("a.addtime desc")
|
|
|
+ ->select();
|
|
|
$data=[];
|
|
|
foreach ($list as $value){
|
|
|
- $value['can']= isset($value['good_catid']) && $value['good_catid'] !=0 ? made($value['good_catid']):[];
|
|
|
+ if($value['order_type']==3|| $value['order_type']==4){
|
|
|
+ $goon = Db::name("good_zixun")->where(["spuCode"=>$value['spuCode'],"is_del"=>0])->find();
|
|
|
+ }else {
|
|
|
+ $goon =Db::name('good_basic')->where(['spuCode'=>$value['spuCode']])->find();
|
|
|
+ }
|
|
|
+ $value['can']= isset($goon['cat_id']) && $goon['cat_id'] !=0 ? made($goon['cat_id']):[];
|
|
|
+ $value['return_fee']= round($value['good_price']*$value['return_num'],2);
|
|
|
$data[]=$value;
|
|
|
}
|
|
|
return app_show(0,"获取成功",['list'=>$data,'count'=>$count]);
|