예제 #1
0
 public function addCard($array)
 {
     if ($id = parent::getModel()->insert($array)) {
         return $id;
     } else {
         return false;
     }
 }
예제 #2
0
 /**
  * 保存文件
  * @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);
     }
 }
예제 #3
0
 public function school()
 {
     /*用户属于一所学校*/
     parent::getModel()->belongs('school');
     return $this;
 }