|
@@ -282,7 +282,7 @@ class NowReportHandle extends Command
|
|
|
'' as '发货方式',
|
|
|
if(ifnull(wsr.is_th,wor.is_th)=0,'否','是') as '供应商是否同意退货',
|
|
|
if(wps.pay_type='0','现结',if(wps.pay_type='1','月结',if(wps.pay_type='2','双月结',wps.pay_type))) as '付款方式'
|
|
|
- ")->cursor();
|
|
|
+ ")->order("wtd.addtime")->cursor();
|
|
|
|
|
|
$com = [];
|
|
|
foreach ($data as $value) {
|
|
@@ -300,7 +300,7 @@ class NowReportHandle extends Command
|
|
|
}else{
|
|
|
$good= Db::name("good_basic")->where(["spuCode"=>$value['产品编码']])->find();
|
|
|
}
|
|
|
- if($value['单位']==1&& $value['退货采购货款']!=0){
|
|
|
+ if($value['单位']==1&& $value['退货采购货款']==0){
|
|
|
$returninfo = Db::name("return_info")->where(["returnCode"=>$value['thCode']])->field("sum(origin_price * num) as cgd_total")->find();
|
|
|
$value['退货采购货款'] = $returninfo['cgd_total']??0;
|
|
|
}
|