Jelajahi Sumber

Merge branch 'wugg' of wugg/phpstock into version1.5

wugg 2 tahun lalu
induk
melakukan
b44b044232
2 mengubah file dengan 42 tambahan dan 0 penghapusan
  1. 39 0
      app/admin/controller/Version.php
  2. 3 0
      app/admin/route/app.php

+ 39 - 0
app/admin/controller/Version.php

@@ -53,4 +53,43 @@ class Version extends BaseController
         }
     }
 
+    public function info(){
+        $projectNo = isset($this->post['projectNo'])&&$this->post['projectNo']!==""?trim($this->post['projectNo']):"";
+        if($projectNo==""){
+            return error_show(1004,"参数projectNo不能为空");
+        }
+
+        $type = isset($this->post['type'])&&$this->post['type']!=="" ? intval($this->post['type']) :0;
+
+        $info =Db::name("project")->where(["projectNo"=>$projectNo,"is_del"=>0])->find();
+        if($info==false){
+            return error_show(1004,"未找到项目信息");
+        }
+        $plat = Db::name("platform")->where(['id'=>$info['platform_id']])->find();
+        $info['platform_name']=isset($plat['platform_name'])?$plat['platform_name']:"";
+        $info['platform_code']=isset($plat['platform_code'])?$plat['platform_code']:"";
+
+        $khinfo = Db::name("customer_info")->where(["companyNo"=>$info['khNo']])->find();
+        $info['khName'] = isset($khinfo['companyName'])?$khinfo['companyName']:"";
+        $company = Db::name("business")->where(["companyNo"=>$info['companyNo']])->find();
+        $info['company'] = isset($company['company'])?$company['company']:"";
+
+        $ladder = Db::name("project_info")->where(['projectNo'=>$projectNo,"is_del"=>0])->select()->toArray();
+        $info['ladder']=[];
+        if(!empty($ladder)){
+            foreach ($ladder as $value){
+                $value["cat_info"]=isset($value['cat_id']) &&$value['cat_id']!=""? made($value['cat_id'],[]):[];
+                $condition  = $type==0?['pgNo'=>$value['pgNo'],"is_del"=>0] : ['pgNo'=>$value['pgNo'],"is_del"=>0,"status"=>1];
+                $feedback = Db::name("project_feedback")->where($condition)->select()->toArray();
+                array_walk($feedback,function (&$v){
+                    $v["cat_info"]=isset($v['cat_id'])&&$v['cat_id']!=""? made($v['cat_id'],[]):[];
+                });
+
+                $value['feedback']=$feedback;
+                $info['ladder'][]=$value;
+            }
+        }
+        return app_show(0,"获取成功",$info);
+    }
+
 }

+ 3 - 0
app/admin/route/app.php

@@ -455,3 +455,6 @@ Route::rule("useedit","admin/Orderuse/edit");
 Route::rule("useinfo","admin/Orderuse/info");
 Route::rule("usestatus","admin/Orderuse/status");
 Route::rule("usedelete","admin/Orderuse/dele");
+
+Route::rule("projectshare","admin/Version/info");
+