功能更新,bug修复
This commit is contained in:
@@ -13,12 +13,18 @@ namespace app\common\model;
|
||||
* 模型基类
|
||||
*/
|
||||
class Base extends \think\Model{
|
||||
|
||||
public function scopeList($query, $map, $field = '*', $limit = 10, $order = 'id desc'){
|
||||
$query->field($field)->where($map)->limit($limit)->order($order);
|
||||
}
|
||||
|
||||
public function scopeWhere($query, $map){
|
||||
$query->where($map);
|
||||
|
||||
protected $type = array(
|
||||
'id' => 'integer',
|
||||
'cover_id' => 'integer',
|
||||
);
|
||||
|
||||
/**
|
||||
* 数据修改
|
||||
* @return [bool] [是否成功]
|
||||
*/
|
||||
public function change(){
|
||||
$data = \think\Request::instance()->post();
|
||||
return $this->save($data, array('id'=>$data['id']));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user