Browse Source

Merge branch 'version1.5' of ssh://192.168.10.210:10022/wugg/stock into version1.5

panlumeng 3 years ago
parent
commit
588e605868
3 changed files with 43 additions and 12 deletions
  1. 30 0
      app/admin/controller/Activity.php
  2. 12 12
      app/admin/controller/Project.php
  3. 1 0
      app/admin/route/app.php

+ 30 - 0
app/admin/controller/Activity.php

@@ -392,5 +392,35 @@ class Activity extends BaseController
         return  app_show(0,"获取成功",$activity);
     }
 
+    public function  actstatus(){
+        $activity_code= isset($this->post['activity_code'])&&$this->post['activity_code']!=="" ?trim($this->post['activity_code']):"";
+        if($activity_code==""){
+            return error_show(1004,"参数activity_code不能为空");
+        }
+        $activity = Db::name("good_activity")->where(["activity_code"=>$activity_code,"is_del"=>0])->find();
+        if($activity==false){
+            return error_show(1004,"未找到活动数据");
+        }
+        $status =  isset($this->post['status'])&&$this->post['status']!=="" ?intval($this->post['status']):"";
+        if($status==""){
+            return error_show(1004,"参数status不能为空");
+        }
+        $remark =isset($tihs->post['remark'])&&$this->post['remark']!="" ? trim($this->post['remark']):"";
+        if($remark=="" &&$status==8){
+            return error_show(1004,"参数remark不能为空");
+        }
+        $activity['status']=$status;
+        $activity['remark']=$remark;
+        $activity['updatetime']=date("Y-m-d H:i:s");
+        $up = Db::name("good_activity")->save($activity);
+        if($up){
+            return  app_show(0,"修改成功");
+        }else{
+            return  error_show(1004,"修改失败");
+        }
+
+    }
+
+
 
 }

+ 12 - 12
app/admin/controller/Project.php

@@ -42,10 +42,10 @@ class Project extends \app\BaseController
         if($arrtime==""){
             return error_show(1004,"参数arrtime不能为空");
         }
-        $low_rate = isset($this->post['low_rate'])&&$this->post['low_rate']!=""?floatval($this->post['low_rate']):"";
-        if($low_rate==""){
-            return error_show(1004,"参数low_rate不能为空");
-        }
+        $low_rate = isset($this->post['low_rate'])&&$this->post['low_rate']!=""?floatval($this->post['low_rate']):"0";
+//        if($low_rate==""){
+//            return error_show(1004,"参数low_rate不能为空");
+//        }
         $ladder = isset($this->post['ladder'])&&!empty($this->post['ladder'])? $this->post['ladder']:"";
         if($ladder==""){
             return error_show(1004,"参数ladder不能为空");
@@ -78,7 +78,7 @@ class Project extends \app\BaseController
                 "addtime"=>date("Y-m-d H:i:s"),
                 "updatetime"=>date("Y-m-d H:i:s")
             ];
-            $pro=Db::name("good_project")->insert($data);
+            $pro=Db::name("project")->insert($data);
             if($pro){
                 if(!empty($ladder)){
                     $la=[];
@@ -129,13 +129,13 @@ class Project extends \app\BaseController
         if($spuCode==""){
             return error_show(1004,"参数spuCode不能为空");
         }
-        $source =isset($this->post['source'])&&$this->post['source']!=="" ?intval($this->post['source']):"";
-        if($source==""){
-            return error_show(1004,"参数source不能为空");
-        }
+        $source =isset($this->post['source'])&&$this->post['source']!=="" ?intval($this->post['source']):"1";
+//        if($source==""){
+//            return error_show(1004,"参数source不能为空");
+//        }
         $good=[];
         if($source==1){
-            $good=Db::name("good_basic")->where(["spuCode"=>$spuCode,"is_del"=>0])->select()->toArray();
+            $good=Db::name("good")->where(["spuCode"=>$spuCode,"is_del"=>0])->select()->toArray();
             if(empty($good)){
                 return error_show(1004,"未找到商品信息");
             }
@@ -163,7 +163,7 @@ class Project extends \app\BaseController
                     $temp['data_source']=$source;
                     $temp['cat_id']=$value['cat_id'];
                     $temp['budget_price']=$projectinfo['budget_price'];
-                    $temp['sale_price']=$value['sale_price'];
+                    $temp['sale_price']=$value['nake_price'];
                     $temp['num']=$projectinfo['num'];
                     $temp['status']=0;
                     $temp['is_del']=0;
@@ -173,7 +173,7 @@ class Project extends \app\BaseController
                     $temp['updatetime']=date("Y-m-d H:i:s");
                     $data[]=$temp;
             }
-            $nu = Db::name("project_feeback")->insertAll($data);
+            $nu = Db::name("project_feedback")->insertAll($data);
             if($nu>0){
                 Db::commit();
                 return app_show(0,"添加成功");

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

@@ -366,6 +366,7 @@ Route::rule('actcost','admin/Activity/cost');
 Route::rule('activity','admin/Activity/activity');
 Route::rule('actexam','admin/Activity/exam');
 Route::rule('actinfo','admin/Activity/info');
+Route::rule('actstatus','admin/Activity/actstatus');
 
 Route::rule('keepbcreate','admin/Keepbrand/create');
 Route::rule('keepblist','admin/Keepbrand/list');