2014-08-03 22:36:14
<?php
 
use Illuminate\Auth\UserTrait;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableTrait;
use Illuminate\Auth\Reminders\RemindableInterface;
 
class User extends Eloquent implements UserInterface, RemindableInterface {
 
	use UserTrait, RemindableTrait;
 
	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'user';
 
  /**
   * Set $timestamps = FALSE to not use the default timestamp on laravel.
   * 
   * @var bool
   */
  public $timestamps = false;
 
	/**
	 * The attributes excluded from the model's JSON form.
	 *
	 * @var array
	 */
	protected $hidden = array('remember_token');
 
  /**
   * Override primary key default.
   */
  protected $primaryKey = 'uid';
 
  protected $guarded = array('uid');
  /**
   * Get idIMs which related to user.
   */
  public static function getidIMRelatedUser($uid = 0) {
    return DB::table('im_user')
              ->where('user_id', '=', $uid)
              ->lists('im_id');
  }
 
  /**
   * Get IMs which related to user.
   */
  public static function getNameIMRelatedUser($uid = 0) {
    return DB::table('im_user')
              ->where('user_id', '=', $uid)
              ->lists('im_nickname');
  }
 
  /**
   * Get All information of IMs.
   */
  public static function getAllIMRelatedUser($uid = 0) {
    return DB::table('im_user')
              ->where('user_id', '=', $uid)
              ->lists('im_id', 'im_nickname');
  }
}
Invalid Email or Password