dealPage($p); $data = $this->alias("s") ->field("s.id,s.game_id,s.game_name,s.server_version,s.server_name,s.start_time,s.create_time,s.show_status") ->where($map) ->order($order) ->page($page,$row) ->select(); $count = $this->alias("s")->where($map)->count(); $result['data'] = $data; $result['count'] = $count; return $result; } /** * [获取单个礼包信息] * @return [mixed] [description] * author cy 707670631 */ public function detail($gift_id,$user_id){ $map['id']=$gift_id; $map['developers']=$user_id; $data=$this ->where($map) ->find(); return $data; } /** * [删除礼包] * @return [mixed] [description] * author cy 707670631 */ public function del($ids){ $map['id']=array('in',$ids); $res=$this->where($map)->delete(); if($res){ return true; }else{ return false; } } /** * 游戏信息保存、更新 * @return bool|mixed * author: xmy 280564871@qq.com */ public function upDate($user_id,$game_id=""){ $data = $this->create(); if(!$data){ return false; } $data['game_name'] = get_game_name($data['game_id']); $data['developers'] = UID; $data['show_status'] = 1; $data['start_time'] = strtotime($data['start_time']); if(empty($data['id'])){ //新增数据 $id = $this->add($data); //添加基础内容 if(!$id){ $this->error = '新增基础内容出错!'; return false; } } else { //更新数据 $status = $this->save(); //更新基础内容 if(false === $status){ $this->error = '更新基础内容出错!'; return false; } } return $data; } }