|
|
@@ -21,6 +21,8 @@ use common\models\UserNetwork;
|
|
|
use common\models\UserRelation;
|
|
|
use Yii;
|
|
|
use common\models\User;
|
|
|
+use yii\data\Pagination;
|
|
|
+use yii\db\Query;
|
|
|
|
|
|
class AtlasController extends BaseController {
|
|
|
public $modelClass = User::class;
|
|
|
@@ -225,13 +227,16 @@ class AtlasController extends BaseController {
|
|
|
*/
|
|
|
public function actionBrandAmbassadorList()
|
|
|
{
|
|
|
- $data = BaUserInfo::find()->alias('I')
|
|
|
- ->select('I.USER_ID, I.USER_NAME, U.REAL_NAME, U.PERIOD_AT, U.WHETHER_UPGRADE, U.BA_UPGRADE_AT')
|
|
|
- ->where('I.REC_UID = :REC_UID', ['REC_UID' => \Yii::$app->user->id])
|
|
|
- ->join('INNER JOIN', BaUser::tableName() . ' AS U', 'I.USER_ID = U.ID')
|
|
|
- ->orderBy('I.CREATED_AT DESC')
|
|
|
- ->asArray()
|
|
|
- ->all();
|
|
|
+ $condition = ' AND I.REC_UID = :REC_UID ';
|
|
|
+ $params[':REC_UID'] = \Yii::$app->user->id;
|
|
|
+ $data = BaUserInfo::lists($condition, $params, [
|
|
|
+ 'select' => 'I.USER_ID, I.USER_NAME, U.REAL_NAME, U.PERIOD_AT, U.WHETHER_UPGRADE, U.BA_UPGRADE_AT',
|
|
|
+ 'from' => BaUserInfo::tableName().' AS I',
|
|
|
+ 'join' => [
|
|
|
+ ['INNER JOIN', BaUser::tableName().' AS U', 'I.USER_ID = U.ID'],
|
|
|
+ ],
|
|
|
+ 'orderBy' => 'I.CREATED_AT DESC',
|
|
|
+ ]);
|
|
|
|
|
|
return static::notice($data);
|
|
|
}
|