/** * 后台接口获取所有用户 * @return json */ public function actionUser() { $like = Yii::$app->request->get('s', null); $mMember = new \frontend\models\Member(); $user = $mMember->getMembers([], $like); echo json_encode($user, JSON_UNESCAPED_UNICODE); }
/** * 内部数据处理,获取规定格式用户信息 * @param string $userIdStr 用户uid字符串 * -"77,78,79" * @return sting $user 规则数据串 * -"黄小姐|13990150258|77,彭浩|15527890728|78,夏燕成|18628116259|79" */ protected function get_rel_user($userIdStr) { $ids = empty($userIdStr) ? [] : explode(',', $userIdStr); if (count($ids) == 0) { return ''; } $conditions = ['uid' => $ids]; $mMember = new \frontend\models\Member(); $user = $mMember->getMembers($conditions); $user = ArrayHelper::getColumn($user, 'nickname'); $user = implode(',', $user); return $user; }