通過數據表 字段 user_id 查詢 字段 nickname 數據
$this->getByUserId( $userid )->value( 'nickname' ); // 當查詢不到時會報錯
等同於:
$this->where( 'user_id' , $userid )->value( 'nickname' );
等同於:
$this->whereUserId( $userid )->value( 'nickname' );
等同於:
$this->getFieldByUserId( $userid, ' nickname ' );
// 查詢時進行模糊查詢吧,比如,當你的 user_id是123時,你傳參的$userid = 123abc,他還是能查出來,= 12345時是空;
// 也就是說他會截取 $userid 前面的數字進行查詢,后面的非數字他都不會管。