|
@@ -480,18 +480,27 @@ 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")->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);
|
|
|
+ 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);
|
|
|
}
|
|
|
|
|
|
//修改活动状态
|