public function addCard($array) { if ($id = parent::getModel()->insert($array)) { return $id; } else { return false; } }
/** * 保存文件 * @method saveName * @param [type] $name [description] * @return [type] [description] * @author NewFuture */ public static function saveName($fid, $name) { if ($name = File::filterName($name)) { return parent::where('use_id', Auth::id())->set('name', $name)->save($fid); } }
public function school() { /*用户属于一所学校*/ parent::getModel()->belongs('school'); return $this; }