|
@@ -3,11 +3,17 @@ declare (strict_types = 1);
|
|
|
|
|
|
namespace app\report\controller;
|
|
namespace app\report\controller;
|
|
|
|
|
|
-use app\model\AccountItem;use app\report\model\ConsultBids;use app\report\model\ConsultInfo;use app\report\model\ConsultOrder;
|
|
|
|
-use app\report\model\OrderOut;use app\report\model\OrderOutChild;use app\report\model\Purchease;
|
|
|
|
|
|
+use app\report\model\GoodBasic;
|
|
|
|
+use app\model\AccountItem;
|
|
|
|
+use app\report\model\ConsultBids;
|
|
|
|
+use app\report\model\ConsultInfo;
|
|
|
|
+use app\report\model\ConsultOrder;
|
|
|
|
+use app\report\model\GoodStock;use app\report\model\OrderOut;
|
|
|
|
+use app\report\model\OrderOutChild;
|
|
|
|
+use app\report\model\Purchease;
|
|
use app\report\model\PurcheaseOrder;
|
|
use app\report\model\PurcheaseOrder;
|
|
use app\report\model\Sale;
|
|
use app\report\model\Sale;
|
|
-use think\db\Query;use think\Request;
|
|
|
|
|
|
+
|
|
use think\App;
|
|
use think\App;
|
|
class Stats extends Base
|
|
class Stats extends Base
|
|
{
|
|
{
|
|
@@ -102,16 +108,16 @@ class Stats extends Base
|
|
$data =$Model->alias("a")->leftJoin("order_num b","a.cgdNo=b.cgdNo")
|
|
$data =$Model->alias("a")->leftJoin("order_num b","a.cgdNo=b.cgdNo")
|
|
->leftJoin("sale c","c.orderCode=b.orderCode and c.is_del=0")
|
|
->leftJoin("sale c","c.orderCode=b.orderCode and c.is_del=0")
|
|
->leftJoin("platform d","d.id=c.platform_id and d.is_del=0")
|
|
->leftJoin("platform d","d.id=c.platform_id and d.is_del=0")
|
|
- ->field("a.cgder,a.cgder_id,a.order_type,d.use_type,count(1) num")
|
|
|
|
- ->group("a.cgder,a.cgder_id,order_type,use_type")
|
|
|
|
|
|
+ ->field("a.companyNo,a.companyName,a.order_type,d.use_type,count(1) num")
|
|
|
|
+ ->group("a.companyNo,a.companyName,order_type,use_type")
|
|
->whereBetween('a.addtime',$time)
|
|
->whereBetween('a.addtime',$time)
|
|
- ->whereIn('a.cgder_id',$uid)
|
|
|
|
|
|
+// ->whereIn('a.cgder_id',$uid)
|
|
->where('a.is_del',0)
|
|
->where('a.is_del',0)
|
|
->select();
|
|
->select();
|
|
$result=[];
|
|
$result=[];
|
|
foreach ($data as $key=>$val){
|
|
foreach ($data as $key=>$val){
|
|
- if(!isset($result[$val['cgder_id']])){
|
|
|
|
- $result[$val['cgder_id']]= [ 'cgder'=>$val['cgder'],
|
|
|
|
|
|
+ if(!isset($result[$val['companyNo']])){
|
|
|
|
+ $result[$val['companyNo']]= [ 'cgder'=>$val['companyName'],
|
|
'total_cgd' => 0,//订单总量
|
|
'total_cgd' => 0,//订单总量
|
|
'tag_1' => 0,//库存品
|
|
'tag_1' => 0,//库存品
|
|
'tag_2' => 0,//非库存品
|
|
'tag_2' => 0,//非库存品
|
|
@@ -120,34 +126,35 @@ class Stats extends Base
|
|
'tag_b' => 0,//to B
|
|
'tag_b' => 0,//to B
|
|
];
|
|
];
|
|
}
|
|
}
|
|
|
|
+ $result[$val['companyNo']]['total_cgd']+=$val['num'];
|
|
switch ($val['order_type']) {
|
|
switch ($val['order_type']) {
|
|
case 1:
|
|
case 1:
|
|
//库存品
|
|
//库存品
|
|
- if ($val['order_source'] == 0) {
|
|
|
|
- $result[$val['cgder_id']]['tag_1']+=$val['num'];
|
|
|
|
- }
|
|
|
|
|
|
+// if ($val['order_source'] == 0) {
|
|
|
|
+ $result[$val['companyNo']]['tag_1']+=$val['num'];
|
|
|
|
+// }
|
|
break;
|
|
break;
|
|
|
|
|
|
case 2:
|
|
case 2:
|
|
//非库存品
|
|
//非库存品
|
|
- $result[$val['cgder_id']]['tag_2']+=$val['num'];
|
|
|
|
|
|
+ $result[$val['companyNo']]['tag_2']+=$val['num'];
|
|
break;
|
|
break;
|
|
case 3:
|
|
case 3:
|
|
//咨询采反
|
|
//咨询采反
|
|
- $result[$val['cgder_id']]['tag_zx']+=$val['num'];
|
|
|
|
|
|
+ $result[$val['companyNo']]['tag_zx']+=$val['num'];
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
switch ($val['use_type']) {
|
|
switch ($val['use_type']) {
|
|
case 1:
|
|
case 1:
|
|
//to B
|
|
//to B
|
|
- $result[$val['cgder_id']]['tag_b']+=$val['num'];
|
|
|
|
|
|
+ $result[$val['companyNo']]['tag_b']+=$val['num'];
|
|
|
|
|
|
break;
|
|
break;
|
|
|
|
|
|
case 2:
|
|
case 2:
|
|
//to C
|
|
//to C
|
|
- $result[$val['cgder_id']]['tag_c']+=$val['num'];
|
|
|
|
|
|
+ $result[$val['companyNo']]['tag_c']+=$val['num'];
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -168,15 +175,19 @@ class Stats extends Base
|
|
$param =$this->request->param(['start'=>date('Y-m-01 00:00:00'),'end'=>date('Y-m-t 23:59:59')]);
|
|
$param =$this->request->param(['start'=>date('Y-m-01 00:00:00'),'end'=>date('Y-m-t 23:59:59')]);
|
|
$time = [$param['start'],$param['end']];
|
|
$time = [$param['start'],$param['end']];
|
|
$model = new ConsultBids();
|
|
$model = new ConsultBids();
|
|
|
|
+ $order =new ConsultInfo();
|
|
$temp=[];
|
|
$temp=[];
|
|
foreach ($this->cgdDerpart as $departid=>$depart){
|
|
foreach ($this->cgdDerpart as $departid=>$depart){
|
|
- $uid =$this->GetDepartId($departid);
|
|
|
|
|
|
+// $uid =$this->GetDepartId($departid);
|
|
$temp[$departid]['name'] =$depart;
|
|
$temp[$departid]['name'] =$depart;
|
|
- $list = $model->whereBetween("addtime",$time)->whereIn("createrid",$uid)->where('is_del',0)->group("createrid,creater")->field
|
|
|
|
- ("creater,createrid,count(1) num")->select();
|
|
|
|
|
|
+ $list = $model->whereBetween("addtime",$time)->where('is_del',0)->group("createrid,creater")->field
|
|
|
|
+ ("creater,createrid,count(1) num")->select()->toArray();
|
|
|
|
+ $list[]= ["creater"=>"竞价单总数","creater_id"=>"","num"=>$order->whereBetween('addtime',$time)->where('is_del',0)->count()];
|
|
|
|
+
|
|
$temp[$departid]['result'] =$list;
|
|
$temp[$departid]['result'] =$list;
|
|
}
|
|
}
|
|
- $this->success('获取成功',array_values($temp));
|
|
|
|
|
|
+
|
|
|
|
+ $this->success('获取成功',array_values($temp));
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -191,13 +202,14 @@ class Stats extends Base
|
|
$time = [$param['start'],$param['end']];
|
|
$time = [$param['start'],$param['end']];
|
|
$model = new ConsultOrder();
|
|
$model = new ConsultOrder();
|
|
$temp=[];
|
|
$temp=[];
|
|
- $uid = (new AccountItem())->GetUidByDepartId(array_keys($this->saleDerpart));
|
|
|
|
|
|
+// $uid = (new AccountItem())->GetUidByDepartId(array_keys($this->saleDerpart));
|
|
$list = $model->alias('a')
|
|
$list = $model->alias('a')
|
|
->leftJoin('consult_info b','wsm_consult_order.zxNo=b.zxNo')
|
|
->leftJoin('consult_info b','wsm_consult_order.zxNo=b.zxNo')
|
|
|
|
+ ->leftJoin('consult_bids c','b.infoNo=c.infoNo')
|
|
->whereBetween('a.addtime',$time)
|
|
->whereBetween('a.addtime',$time)
|
|
- ->whereIn('createrid',$uid)
|
|
|
|
|
|
+ ->whereNull("c.id")
|
|
->where(['a.is_del'=>0,'b.is_del'=>0])
|
|
->where(['a.is_del'=>0,'b.is_del'=>0])
|
|
- ->where('b.status','<>',5)
|
|
|
|
|
|
+// ->where('b.status','<>',5)
|
|
->group('b.status')
|
|
->group('b.status')
|
|
->column('b.status,count(1) num','b.status');
|
|
->column('b.status,count(1) num','b.status');
|
|
$temp['result'] =$list;
|
|
$temp['result'] =$list;
|
|
@@ -215,25 +227,27 @@ class Stats extends Base
|
|
foreach ($this->saleDerpart as $departid=>$sale){
|
|
foreach ($this->saleDerpart as $departid=>$sale){
|
|
$uid = $this->GetDepartId($departid);
|
|
$uid = $this->GetDepartId($departid);
|
|
$temp[$departid]['name'] =$sale;
|
|
$temp[$departid]['name'] =$sale;
|
|
- $build= $model->alias('a')->LeftJoin('warehouse_info b','a.wsm_code=b.wsm_code')
|
|
|
|
- ->whereBetween('a.addtime',$time)
|
|
|
|
|
|
+ $build= $model->alias('a')
|
|
|
|
+// ->whereBetween('a.addtime',$time)
|
|
->whereIn('a.apply_id',$uid)
|
|
->whereIn('a.apply_id',$uid)
|
|
->where('a.is_del',0)
|
|
->where('a.is_del',0)
|
|
- ->field('a.id,ifnull(b.contactor,"0") contactor,ifnull(b.contactor_name,"") as contactor_name ,a.addtime,DATEDIFF(ifnull( a.sendtime, NOW()), a.addtime ) as expire,"" stage')
|
|
|
|
|
|
+ ->whereIn('a.status',[0,1])
|
|
|
|
+ ->field('order_type,DATEDIFF(now(), a.addtime ) as expire,"" stage')
|
|
->withAttr('stage',function ($v,$row){
|
|
->withAttr('stage',function ($v,$row){
|
|
- if($row['expire']==0) return 1;
|
|
|
|
- elseif($row['expire']<2) return 2;
|
|
|
|
- elseif($row['expire']< 7) return 3;
|
|
|
|
- elseif($row['expire']< 14) return 4;
|
|
|
|
- elseif($row['expire']< 30) return 5;
|
|
|
|
|
|
+ if($row['expire']>=0 && $row['expire']<=1) return 1;
|
|
|
|
+ elseif($row['expire']<=2) return 2;
|
|
|
|
+ elseif($row['expire']<=7) return 3;
|
|
|
|
+ elseif($row['expire']<=14) return 4;
|
|
|
|
+ elseif($row['expire']<=30) return 5;
|
|
else return 6;
|
|
else return 6;
|
|
})->select();
|
|
})->select();
|
|
$tlist=[];
|
|
$tlist=[];
|
|
|
|
+ $order_type_name = ["1"=>"库存品","2"=>"非库存品","3"=>"咨询采返",'4'=>'报备'];
|
|
foreach ($build as $item){
|
|
foreach ($build as $item){
|
|
- if(!isset($tlist[$item['contactor']])){
|
|
|
|
- $tlist[$item['contactor']]=[$item['contactor_name'],0,0,0,0,0,0];
|
|
|
|
|
|
+ if(!isset($tlist[$item['order_type']])){
|
|
|
|
+ $tlist[$item['order_type']]=[$order_type_name[$item['order_type']]?:"",0,0,0,0,0,0];
|
|
}
|
|
}
|
|
- $tlist[$item['contactor']][$item['stage']]+=1;
|
|
|
|
|
|
+ $tlist[$item['order_type']][$item['stage']]+=1;
|
|
}
|
|
}
|
|
$temp[$departid]['result'] =$tlist?:[];
|
|
$temp[$departid]['result'] =$tlist?:[];
|
|
}
|
|
}
|
|
@@ -253,25 +267,27 @@ class Stats extends Base
|
|
foreach ($this->saleDerpart as $departid=>$sale){
|
|
foreach ($this->saleDerpart as $departid=>$sale){
|
|
$uid = $this->GetDepartId($departid);
|
|
$uid = $this->GetDepartId($departid);
|
|
$temp[$departid]['name'] =$sale;
|
|
$temp[$departid]['name'] =$sale;
|
|
- $build= $model->alias('a')->LeftJoin('warehouse_info b','a.wsm_code=b.wsm_code')
|
|
|
|
- ->whereBetween('a.addtime',$time)
|
|
|
|
|
|
+ $build= $model->alias('a')
|
|
|
|
+// ->whereBetween('a.addtime',$time)
|
|
->whereIn('a.apply_id',$uid)
|
|
->whereIn('a.apply_id',$uid)
|
|
->where('a.is_del',0)
|
|
->where('a.is_del',0)
|
|
- ->field('a.id,ifnull(b.contactor,"0") contactor,ifnull(b.contactor_name,"") as contactor_name ,a.addtime,DATEDIFF(ifnull( a.sendtime, NOW()), a.addtime ) as expire,"" stage')
|
|
|
|
|
|
+ ->where('a.status',"=",0)
|
|
|
|
+ ->field('order_type,DATEDIFF(ifnull( a.sendtime, NOW()), a.addtime ) as expire,"" stage')
|
|
->withAttr('stage',function ($v,$row){
|
|
->withAttr('stage',function ($v,$row){
|
|
- if($row['expire']==0) return 1;
|
|
|
|
- elseif($row['expire']<2) return 2;
|
|
|
|
- elseif($row['expire']< 7) return 3;
|
|
|
|
- elseif($row['expire']< 14) return 4;
|
|
|
|
- elseif($row['expire']< 30) return 5;
|
|
|
|
|
|
+ if($row['expire']>=0 && $row['expire']<=1) return 1;
|
|
|
|
+ elseif($row['expire']<=2) return 2;
|
|
|
|
+ elseif($row['expire']<=7) return 3;
|
|
|
|
+ elseif($row['expire']<=14) return 4;
|
|
|
|
+ elseif($row['expire']<=30) return 5;
|
|
else return 6;
|
|
else return 6;
|
|
})->select();
|
|
})->select();
|
|
$tlist=[];
|
|
$tlist=[];
|
|
- foreach ($build as $item){
|
|
|
|
- if(!isset($tlist[$item['contactor']])){
|
|
|
|
- $tlist[$item['contactor']]=[$item['contactor_name'],0,0,0,0,0,0];
|
|
|
|
|
|
+ $order_type_name = ['1'=>'库存品','2'=>'非库存品','3'=>'咨询采返','4'=>'报备'];
|
|
|
|
+ foreach ($build as $item){
|
|
|
|
+ if(!isset($tlist[$item['order_type']])){
|
|
|
|
+ $tlist[$item['order_type']]=[$order_type_name[$item['order_type']]?:'',0,0,0,0,0,0];
|
|
}
|
|
}
|
|
- $tlist[$item['contactor']][$item["stage"]]+=1;
|
|
|
|
|
|
+ $tlist[$item['order_type']][$item['stage']]+=1;
|
|
}
|
|
}
|
|
$temp[$departid]['result'] =$tlist;
|
|
$temp[$departid]['result'] =$tlist;
|
|
}
|
|
}
|
|
@@ -279,7 +295,7 @@ class Stats extends Base
|
|
}
|
|
}
|
|
//未发货数据
|
|
//未发货数据
|
|
public function wsendOrder(){
|
|
public function wsendOrder(){
|
|
-
|
|
|
|
|
|
+ $param =$this->request->param(['start_y'=>date('Y')]);
|
|
$temp=[];
|
|
$temp=[];
|
|
$model =new Sale();
|
|
$model =new Sale();
|
|
$userArr=[];
|
|
$userArr=[];
|
|
@@ -288,13 +304,18 @@ class Stats extends Base
|
|
$userArr=array_merge($userArr,$uid);
|
|
$userArr=array_merge($userArr,$uid);
|
|
$temp[$departid]["name"] = $depart;
|
|
$temp[$departid]["name"] = $depart;
|
|
$start = 1;
|
|
$start = 1;
|
|
- $end = date("m");
|
|
|
|
|
|
+ $end = $param['start_y']<date('Y')?12: date("m");
|
|
while ($start<=$end){
|
|
while ($start<=$end){
|
|
- $list = $model->whereIn('status',[0,1])
|
|
|
|
- ->whereIn("send_status",[1,2])
|
|
|
|
|
|
+ $list = $model->alias('a')
|
|
|
|
+ ->whereIn('status',[0,1])
|
|
|
|
+ ->whereIn('send_status',[1,2])
|
|
|
|
+ ->where('is_del',0)
|
|
->whereIn('apply_id',$uid)
|
|
->whereIn('apply_id',$uid)
|
|
- ->whereMonth('addtime',date('Y').'-'.$start)
|
|
|
|
- ->group('send_status')->column('sum(wsend_num) num,send_status','send_status');
|
|
|
|
|
|
+ ->whereMonth('addtime',$param['start_y'].'-'.str_pad($start.'' , 2,'0',0))
|
|
|
|
+ ->where('good_num-th_num > ifnull((select sum(receipt_quantity) from wsm_order_addr where orderCode=a.orderCode and is_del=0),0)')
|
|
|
|
+ ->group('send_status')
|
|
|
|
+ ->column('count(1) num ,send_status','send_status');
|
|
|
|
+// echo $param['start'].'-'.str_pad($start.'' , 2,'0',0);
|
|
$temp[$departid]['result'][$start]=$list;
|
|
$temp[$departid]['result'][$start]=$list;
|
|
$start++;
|
|
$start++;
|
|
}
|
|
}
|
|
@@ -303,21 +324,82 @@ class Stats extends Base
|
|
$noArr=[];
|
|
$noArr=[];
|
|
$noArr['name'] = "无地址订单";
|
|
$noArr['name'] = "无地址订单";
|
|
$start = 1;
|
|
$start = 1;
|
|
- $end = date('m');
|
|
|
|
|
|
+ $end = $param['start_y']<date('Y')?12: date('m');
|
|
while ($start<=$end){
|
|
while ($start<=$end){
|
|
-// $month = $start;
|
|
|
|
|
|
+// $month = $start;a
|
|
$list = $model->whereIn('status',[0,1])
|
|
$list = $model->whereIn('status',[0,1])
|
|
->whereIn('send_status',[1,2])
|
|
->whereIn('send_status',[1,2])
|
|
->whereIn('apply_id',$userArr)
|
|
->whereIn('apply_id',$userArr)
|
|
- ->whereMonth('addtime',date('Y').'-'.$start)
|
|
|
|
- ->field("sale_price,orderCode")
|
|
|
|
- ->append(["no_addr_num"=>function(Query $query,$data){
|
|
|
|
- $query->name('order_addr')->where(['orderCode'=>$data['orderCode'],'is_del'=>0])->sum('receipt_quantity');
|
|
|
|
- }])
|
|
|
|
- ->find();
|
|
|
|
- $noArr['result'][$start]['total_price']=bcmul($list['sale_price'],$list['no_addr_num'].'',2);
|
|
|
|
|
|
+ ->where('is_del',0)
|
|
|
|
+ ->whereMonth('addtime',$param['start_y'].'-'.str_pad($start.'' , 2,'0',0))
|
|
|
|
+ ->field('sale_price,orderCode,good_num,total_price,0 addr_num, 0 before_th')
|
|
|
|
+ ->withAttr('addr_num',function($v,$data){
|
|
|
|
+ $num = Sale::name('order_addr')->where(['orderCode'=>$data['orderCode'],'is_del'=>0])->sum
|
|
|
|
+ ('receipt_quantity');
|
|
|
|
+ return bcmul($data['sale_price'],strval($num),2);
|
|
|
|
+ })
|
|
|
|
+ ->withAttr('before_th' , function ($v , $data) {
|
|
|
|
+ $num= Sale::name('sale_return')->where(['orderCode'=>$data['orderCode'] , 'is_del'=>0,
|
|
|
|
+ 'status'=>4])->sum('num');
|
|
|
|
+ return bcmul($data['sale_price'],strval($num),2);
|
|
|
|
+ }
|
|
|
|
+ )
|
|
|
|
+ ->select();
|
|
|
|
+ if($list->isEmpty())$noArr['result'][$start]['total_price']==0;
|
|
|
|
+ else{
|
|
|
|
+ $total =strval(array_sum(array_column($list->toArray() , 'total_price')));
|
|
|
|
+ $before_th =strval(array_sum(array_column($list->toArray() , 'before_th')));
|
|
|
|
+ $addr_num =strval(array_sum(array_column($list->toArray() , 'addr_num')));
|
|
|
|
+ $noArr['result'][$start]['total_price']=bcsub(bcsub($total,$before_th,2),$addr_num,2);
|
|
|
|
+ }
|
|
|
|
+
|
|
$start++;
|
|
$start++;
|
|
}
|
|
}
|
|
- $this->success('获取成功',["result"=>array_values($temp),"noAddr"=>$noArr]);
|
|
|
|
|
|
+ $this->success('获取成功',["result"=>array_values($list)]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //发货单维度商品每日库存
|
|
|
|
+ public function goodStock(){
|
|
|
|
+ $param =$this->request->param(['spuCode'=>'','good_name'=>'','companyNo'=>'','page'=>1,
|
|
|
|
+ 'size'=>10]);
|
|
|
|
+ $where=[["is_del","=",0]];
|
|
|
|
+ $param['spuCode']==''?: $where[]=["spuCode","like","%{$param['spuCode']}%"];
|
|
|
|
+ $param['good_name']==''?: $where[]=["good_name","like","%{$param['good_name']}%"];
|
|
|
|
+ $param['companyNo']==''?: $where[]=["companyNo","like","%{$param['companyNo']}%"];
|
|
|
|
+ $model = new GoodBasic();
|
|
|
|
+ $stock = new GoodStock();
|
|
|
|
+ $list=$model->where($where)->visible(["spuCode","good_name",'spec_info','cat_info','usable_stock',
|
|
|
|
+ 'total_stock','wait_in_stock','wait_out_stock',"child"])->withAttr("child",function($v,$data) use($stock ){
|
|
|
|
+ return $stock->withJoin(["wareinfo"],"left")
|
|
|
|
+ ->where("spuCode",$data['spuCode'])
|
|
|
|
+ ->column("wareinfo.name,contactor_name,supplierName,companyName,usable_stock+wait_out_stock total_stock,usable_stock,wait_out_stock,wait_in_stock");
|
|
|
|
+
|
|
|
|
+ })->paginate(["list_rows"=>$param['size'], "page"=>$param["page"]]);
|
|
|
|
+
|
|
|
|
+ $this->success('获取成功',['result'=>$list->items(),"count"=>$list->total()]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ //发货单维度商品每日库存
|
|
|
|
+ public function outChildStock(){
|
|
|
|
+ $param =$this->request->param(['start'=>date('Y-m-01 00:00:00'),'end'=>date('Y-m-t 23:59:59'),'page'=>1,
|
|
|
|
+ 'size'=>10]);
|
|
|
|
+ $time = [$param['start'],$param['end']];
|
|
|
|
+ $model = new OrderOutChild();
|
|
|
|
+ $list = $model
|
|
|
|
+ ->where(["status"=>2,"order_type"=>1,"is_del"=>0])
|
|
|
|
+ ->whereBetween("sendtime",$time)
|
|
|
|
+ ->field("spuCode,good_name,companyName,sum(num) num")
|
|
|
|
+ ->group('good_name,companyName,spuCode')
|
|
|
|
+ ->paginate(['list_rows'=>$param['size'], 'page'=>$param['page']]);
|
|
|
|
+ foreach ($list->items() as &$value){
|
|
|
|
+ $value['stock_num'] = (new GoodStock())->where('spuCode',$value['good_code'])->sum('usable_stock');
|
|
|
|
+ $value['good_price'] = (new PurcheaseOrder())->where(['spuCode'=>$value['good_code'],'order_source'=>0])->value('good_price',0);
|
|
|
|
+ $value['total_fee'] = bcmul(strval($value['good_price']),strval($value['good_num']),2);
|
|
|
|
+ }
|
|
|
|
+ $this->success('获取成功',['result'=>$list->items(),'count'=>$list->total()]);
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|