目录结构更新,增加composer支持
This commit is contained in:
@@ -1,40 +1,8 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
/**
|
||||
* 模型基类
|
||||
*/
|
||||
class Base extends \think\Model{
|
||||
use think\Model;
|
||||
|
||||
protected $param;
|
||||
protected $type = array(
|
||||
'id' => 'integer',
|
||||
'cover_id' => 'integer',
|
||||
);
|
||||
class Base extends Model {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user