wufeng 2 years ago
parent
commit
eed72c20a3
1 changed files with 12 additions and 21 deletions
  1. 12 21
      app/admin/controller/Activity.php

+ 12 - 21
app/admin/controller/Activity.php

@@ -480,27 +480,18 @@ class Activity extends Base
     }
 
     //活动详情
-    public function info()
-    {
-        $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")
-            ->alias('ga')
-            ->field('ga.*,p.platform_name')
-            ->leftJoin('platform p', 'p.id=ga.platform_code AND p.is_del=0')
-            ->where(["ga.activity_code" => $activity_code, "ga.is_del" => 0])
-            ->find();
-        if ($activity == false) {
-            return error_show(1004, "未找到活动数据");
-        }
-        $activity_info = Db::name("activity_info")
-            ->where(["activity_code" => $activity_code, "is_del" => 0])
-            ->select()
-            ->toArray();
-        $activity['info'] = empty($activity_info) ? [] : $activity_info;
-        return app_show(0, "获取成功", $activity);
+    public function  info(){
+        $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,"未找到活动数据");
+        }
+        $activity_info =Db::name("activity_info")->where(["activity_code"=>$activity_code,"is_del"=>0])->select();
+        $activity['info']=empty($activity_info)?[]:$activity_info;
+        return  app_show(0,"获取成功",$activity);
     }
 
     //修改活动状态