|
@@ -90,6 +90,48 @@ class Purchin extends BaseController
|
|
|
->order("a.addtime desc")->select();
|
|
|
$data=[];
|
|
|
foreach ($list as $value){
|
|
|
+
|
|
|
+ //获取规格、品牌信息
|
|
|
+ if ($value['order_type'] == 3 || $value['order_type'] == 4) {
|
|
|
+ $temp = Db::name('good_zixun')
|
|
|
+ ->alias('gz')
|
|
|
+ ->field('gz.specinfo,b.brand_name')
|
|
|
+ ->join('brand b', 'b.id=gz.brand_id')
|
|
|
+ ->where(['gz.spuCode' => $value['spuCode'], 'gz.is_del' => 0])
|
|
|
+ ->find();
|
|
|
+ $value["brand_name"] = $temp['brand_name'];
|
|
|
+ $value["speclist"] = json_decode($temp['specinfo'], true);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ $value['brand_name'] = Db::name('good_basic')
|
|
|
+ ->alias('gb')
|
|
|
+ ->join('brand b', 'b.id=gb.brand_id')
|
|
|
+ ->where(['gb.spuCode' => $value['spuCode']])
|
|
|
+ ->value('b.brand_name');
|
|
|
+
|
|
|
+ $spec = Db::name("good_spec")
|
|
|
+ ->where(["spuCode" => $value['spuCode'], "is_del" => 0])
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
+ $speclist = [];
|
|
|
+ if (!empty($spec)) {
|
|
|
+ foreach ($spec as $val) {
|
|
|
+ $temp = [];
|
|
|
+ $temp['id'] = $val['id'];
|
|
|
+ $temp['spuCode'] = $val['spuCode'];
|
|
|
+ $temp['spec_id'] = $val['spec_id'];
|
|
|
+ $temp['spec_value_id'] = $val['spec_value_id'];
|
|
|
+ $sp = Db::name("specs")->where(["id" => $val['spec_id']])->find();
|
|
|
+ $temp['spec_name'] = isset($sp["spec_name"]) ? $sp["spec_name"] : "";
|
|
|
+ $spv = Db::name("spec_value")->where(["id" => $val['spec_value_id']])->find();
|
|
|
+ $temp['spec_value'] = isset($spv["spec_value"]) ? $spv["spec_value"] : "";
|
|
|
+ $speclist[] = $temp;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $value["speclist"] = empty($speclist) ? [] : $speclist;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
$wsmcode = Db::name("warehouse_info")->alias("k")->leftJoin("supplier c","k.supplierNo=c.code")
|
|
|
->where(["k.wsm_code"=>$value['wsm_code']])->field("k.name as wsm_name,c.name,c.code")->find();
|
|
|
$value['wsm_name'] = $wsmcode['wsm_name'];
|