select(['id']) ->andWhere(['mall_id' => $mall_id]) ->andWhere([ 'or', ['like', 'nickname', $key_word], ['like', 'mobile', $key_word], ]) ->column(); } /** * 获取推荐人ID * * @param integer $user_id * @return string|int|null|false the value of the first column in the first row of the query result. */ public static function getParentId(int $user_id) { return static::find() ->where(['id' => $user_id]) ->select('parent_id') ->scalar(); } }