pull/1/head
lqmac 9 months ago
parent 3e9d8aa588
commit 82168322b1
  1. 40
      app/api/controller/User.php

@ -14,6 +14,7 @@ namespace app\api\controller;
use app\api\model\Agreement as AgreementModel; use app\api\model\Agreement as AgreementModel;
use app\api\model\User as UserModel; use app\api\model\User as UserModel;
use app\api\model\Invite\InviteLog;
use app\store\model\User as StoreUserModel; use app\store\model\User as StoreUserModel;
use app\api\model\user\BalanceLog; use app\api\model\user\BalanceLog;
use app\api\model\user\GoodSource as GoodsSourceModel; use app\api\model\user\GoodSource as GoodsSourceModel;
@ -326,7 +327,46 @@ class User extends Controller
// 用户列表 // 用户列表
$model = new StoreUserModel; $model = new StoreUserModel;
$list = $model->getList($this->request->param()); $list = $model->getList($this->request->param());
if (!$list) {
return $this->renderSuccess(compact('list'));
}
$list = $list->toArray();
// echo "<pre>";
// print_r($list);
// exit();
foreach ($list['data'] as $key => &$value) {
$log = InviteLog::where('invitee_user_id', $value['user_id'])->find();
$user = UserModel::where('user_id', $log['user_id'] ?? 0)->field('user_id,nick_name,mobile')->find();
$value['inviter'] = $user;
}
return $this->renderSuccess(compact('list')); return $this->renderSuccess(compact('list'));
} }
public function updateUser(): Json
{
$params = $this->request->param();
$user_id = $params['user_id'] ?? 0;
unset($params['user_id']);
UserModel::where('user_id', $user_id)->update($params);
return $this->renderSuccess('ok');
}
} }

Loading…
Cancel
Save