123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- /**
- * SignRewordModel.php UTF-8
- *
- *
- * @date : 2018/5/4 19:45
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : wuyonghong <wyh@huosdk.com>
- * @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;
- }
- }
- }
|