|
@@ -258,6 +258,16 @@ class Good extends Base
|
|
|
$proof =Db::name("good_proof")->where(["spuCode"=>$good_platform['spuCode'],"is_del"=>0])->order("updatetime desc")->field("id,proof_type,proof_url")->find();
|
|
|
$data['proof'] = isset($proof)&&$proof!=false? $proof:[];
|
|
|
$data["nakelist"]=$nakearry;
|
|
|
+
|
|
|
+ //补充采购员字段
|
|
|
+ //成本表里的创建人,也是线上商品的采购人,为了防止混淆,给creater取个别名
|
|
|
+ $temp_basic_info = Db::name('good_basic')
|
|
|
+ ->field('id,createrid purchase_id,creater purchase')
|
|
|
+ ->where(['spuCode'=>$data['spuCode'],'is_del'=>0])
|
|
|
+ ->find();
|
|
|
+ $data['purchase_id'] = $temp_basic_info['purchase_id'];
|
|
|
+ $data['purchase'] = $temp_basic_info['purchase'];
|
|
|
+
|
|
|
return app_show(0,"获取成功",$data);
|
|
|
}
|
|
|
|
|
@@ -677,7 +687,7 @@ class Good extends Base
|
|
|
$statlist = Db::name("good_stock")
|
|
|
->alias('gs')
|
|
|
->where($condition)
|
|
|
- ->where('whi.wsm_type','<>',2)//2表示虚拟仓
|
|
|
+ ->where('whi.wsm_type','<>',2)//2表示虚拟仓,虚拟仓不参与
|
|
|
->leftJoin('warehouse_info whi','whi.wsm_code=gs.wsm_code AND whi.is_del=0')
|
|
|
->field("sum(gs.wait_in_stock) as wait_in_stock,sum(gs.wait_out_stock) as wait_out_stock ,sum(gs.usable_stock) as usable_stock,sum(gs.intra_stock) as intra_stock,sum(gs.total_stock) as total_stock,sum(gs.warn_stock) as warn_stock")
|
|
|
->find();
|