功能更新,bug修复

This commit is contained in:
2016-06-29 15:01:55 +08:00
parent 6f1790bc3b
commit c8e979b159
14 changed files with 277 additions and 128 deletions

View File

@@ -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']));
}
}