* @version : HUOSDK 8.0 */ namespace huo\model\sign; use huo\model\common\CommonModel; class SignRewordModel extends CommonModel { protected $name = 'sign_reward_week'; //设置只读字段 // 开启自动写入时间戳字段 protected $autoWriteTimestamp = true; public function addConf($data) { if (empty($data)) { return false; } if ($_obj = self::create($data, true)) { return $_obj->id; } else { return false; } } /** * @return array|false|\PDOStatement|string|\think\Collection */ public function getConf() { $_field = 'id,sign_days,integral,icon,name,desc'; $_data = $this->field($_field)->order('sign_days asc')->column($_field, 'sign_days'); return $_data; } /** * 更新游戏 * * @param array $conf_data * @param int $sc_id * * @return bool */ public function updateConf($conf_data, $sc_id) { $_map['id'] = $sc_id; $_data = $conf_data; $_rs = self::update($_data, $_map, true); if (false == $_rs) { return false; } else { return true; } } }