|
@@ -31,14 +31,14 @@ class Good extends \app\BaseController
|
|
|
{
|
|
|
parent::__construct($app);
|
|
|
$this->post = $this->request->post();
|
|
|
- $token = isset($this->post['token']) ? trim($this->post['token']) : "";
|
|
|
- if($token==""){
|
|
|
- return error_show(101,'token不能为空');
|
|
|
- }
|
|
|
- $effetc = VerifyTokens($token);
|
|
|
- if(!empty($effetc) && $effetc['code']!=0){
|
|
|
- return error_show($effetc['code'],$effetc['message']);
|
|
|
- }
|
|
|
+// $token = isset($this->post['token']) ? trim($this->post['token']) : "";
|
|
|
+// if($token==""){
|
|
|
+// return error_show(101,'token不能为空');
|
|
|
+// }
|
|
|
+// $effetc = VerifyTokens($token);
|
|
|
+// if(!empty($effetc) && $effetc['code']!=0){
|
|
|
+// return error_show($effetc['code'],$effetc['message']);
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
public function list(){
|
|
@@ -120,7 +120,72 @@ class Good extends \app\BaseController
|
|
|
}
|
|
|
return app_show(0,"获取成功",['list'=>$data,'count'=>$count]);
|
|
|
}
|
|
|
- public function SetWarn(){
|
|
|
+
|
|
|
+ public function info(){
|
|
|
+ $skucode=isset($this->post['skuCode'])&&$this->post['skuCode']!=""?trim($this->post['skuCode']):"";
|
|
|
+ if($skucode==""){
|
|
|
+ return error_show(1005,"参数skuCode不能为空");
|
|
|
+ }
|
|
|
+ $good_platform = Db::name("good_platform")->where(['skuCode'=>$skucode,"is_del"=>0])->find();
|
|
|
+ if($good_platform==false){
|
|
|
+ return error_show(1004,"未找到商品数据");
|
|
|
+ }
|
|
|
+ $data = Db::name("good")->where(["spuCode"=>$good_platform['spuCode'],"is_del"=>0])->find();
|
|
|
+ if($data==false){
|
|
|
+ return error_show(1004,"未找到商品数据");
|
|
|
+ }
|
|
|
+ $plat =Db::name("platform")->where(["platform_code"=>$good_platform['platform_code']])->find();
|
|
|
+ $data['skuCode']=$good_platform['skuCode'];
|
|
|
+ $data['platform_code']=$good_platform['platform_code'];
|
|
|
+ $data['platform_name']=isset($plat['platform_name'])?$plat['platform_name']:"";
|
|
|
+ $data['online_reason']=$good_platform['online_reason'];
|
|
|
+ $data['online_time']=$good_platform['online_time'];
|
|
|
+ $data['online_remark']=$good_platform['online_remark'];
|
|
|
+ $data['exam_status']=$good_platform['exam_status'];
|
|
|
+ $data['is_online']=$good_platform['is_online'];
|
|
|
+ $unit =Db::name("unit")->where(["id"=>$data['good_unit']])->find();
|
|
|
+ $data['unit'] = isset($unit['unit'])?$unit['unit']:'';
|
|
|
+ $data['cat_info'] = made($data['cat_id'],[]);
|
|
|
+ $spec = Db::name("good_spec")->where(["spuCode"=>$good_platform['spuCode'],"is_del"=>0])->select()->toArray();
|
|
|
+ $supplier = Db::name("supplier")->where(["code"=>$data['supplierNo']])->find();
|
|
|
+ $data['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
|
|
|
+// $supplier = Db::name("supplier")->where(["code"=>$data['supplierNo']])->find();
|
|
|
+// $data['supplierName'] = isset($supplier['name'])?$supplier['name']:"";
|
|
|
+ $company = Db::name("business")->where(["companyNo"=>$data['companyNo']])->find();
|
|
|
+ $data['company'] = isset($company['company'])?$company['company']:"";
|
|
|
+ if($data['brand_id']!=0){
|
|
|
+ $brand=Db::name("brand")->where(["id"=>$data['brand_id']])->find();
|
|
|
+ $data["brand_name"]=isset($brand['brand_name'])?$brand['brand_name']:"";
|
|
|
+ }else{
|
|
|
+ $data["brand_name"]="";
|
|
|
+ $data["brand_id"]="";
|
|
|
+ }
|
|
|
+ $data["good_info_img"]=$data['good_info_img']!=""? json_decode($data['good_info_img'],true):[];
|
|
|
+ $speclist=[];
|
|
|
+ if(!empty($spec)){
|
|
|
+ foreach ($spec as $value){
|
|
|
+ $temp=[];
|
|
|
+ $temp['id']=$value['id'];
|
|
|
+ $temp['spuCode']=$value['spuCode'];
|
|
|
+ $temp['spec_id']=$value['spec_id'];
|
|
|
+ $temp['spec_value_id']=$value['spec_value_id'];
|
|
|
+ $temp['is_del']=$value['is_del'];
|
|
|
+ $sp = Db::name("specs")->where(["id"=>$value['spec_id']])->find();
|
|
|
+ $temp['spec_name']=isset($sp["spec_name"]) ? $sp["spec_name"]:"";
|
|
|
+ $spv = Db::name("spec_value")->where(["id"=>$value['spec_value_id']])->find();
|
|
|
+ $temp['spec_value']=isset($spv["spec_value"]) ? $spv["spec_value"]:"";
|
|
|
+ $speclist[]=$temp;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $data["speclist"]=empty($speclist)?[]:$speclist;
|
|
|
+ // $nake=[];
|
|
|
+ $ladder = Db::name("good_ladder")->where(['skuCode'=>$skucode,"is_del"=>0])->select()->toArray();
|
|
|
+ $data["ladderlist"]=!empty($ladder)?$ladder:[];
|
|
|
+ return app_show(0,"获取成功",$data);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public function SetWarn(){
|
|
|
$condition=["is_del"=>0];
|
|
|
$wsm_code = isset($this->post['wsm_code']) &&$this->post['wsm_code'] !=="" ? trim($this->post['wsm_code']):"";
|
|
|
if($wsm_code!=""){
|