create($data); if(empty($data)){ return false; } return $this->add($data); } /** * 获取数据列表 * @param $map * @param $p * @param string $order * @param int $row * @return mixed * author: xmy 280564871@qq.com */ public function getDataLists($map,$p,$order="c.status asc,c.create_time desc",$row=10){ $page = $this->dealPage($p); $data['data'] = $this->alias("c")->field("c.*,g.game_name,d.account") ->join("left join tab_game g on g.id = c.game_id") ->join("left join tab_developers d on d.id = c.develop_id") ->where($map) ->order($order) ->page($page,$row) ->select(); $data['count'] = $this->alias("c")->where($map)->count(); return $data; } /** * 签署合同 * @param $map * @return bool * author: xmy 280564871@qq.com */ public function sign_contract($map){ $data = $this->where($map)->find(); if ($data['status'] != 2){ return false; }else{ $data['status'] = 1; return $res = $this->save($data); } } /** * 确认合同 * @param $map * @return bool * author: xmy 280564871@qq.com */ public function sure_contract($map,$end_time){ $data = $this->where($map)->find(); if ($data['status'] != 1){ return false; }else{ $data['start_time'] = time(); $data['end_time'] = strtotime($end_time); $data['status'] = 4; //确认合同后游戏上线 $Game = new GameModel(); $Game->setOnline($data['game_id']); return $this->save($data); } } }