matchScreenModel = new MatchScreen(); } public function addScreen($param) { $param['look_pwd'] = md5($param['look_pwd']); $screen_info = $this->matchScreenModel->where("match_id", "eq", $param['match_id']) ->where("type", $param['type']) ->find(); if (!empty($screen_info)) { $param['id'] = $screen_info->id; if ($param['nopass'] == "false") { $param['look_pwd'] = null; } unset($param['nopass']); try { return $this->matchScreenModel->update($param); } catch (\Exception $exception) { $this->error($exception->getMessage()); } } else { unset($param['nopass']); try { return $this->matchScreenModel->insert($param); } catch (\Exception $exception) { $this->error($exception->getMessage()); } } } public function getScreen($param) { try { return $this->matchScreenModel->where($param)->field("title, id, backound_img, font_rgb")->find(); } catch (\Exception $exception) { $this->error($exception->getMessage()); } } }