36 lines
784 B
PHP
36 lines
784 B
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | 小说系统 [ WE CAN DO IT JUST THINK IT ]
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\common\model;
|
|
|
|
/**
|
|
* 模型基类
|
|
*/
|
|
class Base extends \think\Model{
|
|
|
|
protected $param;
|
|
protected $type = array(
|
|
'id' => 'integer',
|
|
'cover_id' => 'integer',
|
|
);
|
|
|
|
public function initialize(){
|
|
parent::initialize();
|
|
$this->param = \think\Request::instance()->param();
|
|
}
|
|
|
|
/**
|
|
* 数据修改
|
|
* @return [bool] [是否成功]
|
|
*/
|
|
public function change(){
|
|
$data = \think\Request::instance()->post();
|
|
if (isset($data['id']) && $data['id']) {
|
|
return $this->save($data, array('id'=>$data['id']));
|
|
}else{
|
|
return $this->save($data);
|
|
}
|
|
}
|
|
} |