2023-09-18 09:11:13 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\adminapi\controller\user;
|
|
|
|
|
|
|
|
use app\adminapi\controller\BaseAdminController;
|
|
|
|
use app\adminapi\lists\user\UserLists;
|
|
|
|
use app\adminapi\logic\user\UserLogic;
|
2023-09-21 15:31:01 +08:00
|
|
|
use app\common\model\systems\System;
|
2023-09-19 16:47:40 +08:00
|
|
|
use app\common\validate\user\UserBalanceValidate;
|
|
|
|
use app\common\validate\user\UserIntegralValidate;
|
2023-09-18 09:11:13 +08:00
|
|
|
use app\common\validate\user\UserValidate;
|
|
|
|
use think\response\Json;
|
|
|
|
|
|
|
|
class UserController extends BaseAdminController
|
|
|
|
{
|
|
|
|
// 用户列表
|
|
|
|
public function lists(): Json
|
|
|
|
{
|
|
|
|
return $this->dataLists(new UserLists());
|
|
|
|
}
|
2023-11-16 16:53:01 +08:00
|
|
|
// 供销系统公司负责人
|
2023-11-16 11:11:08 +08:00
|
|
|
public function taskLists(): Json
|
|
|
|
{
|
|
|
|
$params=$this->request->get(['page_no','page_size','company_id', 'account', 'mobile']);
|
|
|
|
$result = curl_post(env('project.worker_domain').'/middleapi/user/lists',$params,$this->reqHeader);
|
|
|
|
if($result['code'] == 0){
|
|
|
|
return $this->fail($result['msg']);
|
|
|
|
}
|
|
|
|
return json($result);
|
|
|
|
}
|
|
|
|
|
2023-09-18 09:11:13 +08:00
|
|
|
// 获取用户详情
|
|
|
|
public function detail(): Json
|
|
|
|
{
|
|
|
|
$params = (new UserValidate())->goCheck('detail');
|
|
|
|
$detail = UserLogic::detail($params['id']);
|
|
|
|
return $this->success('', $detail);
|
|
|
|
}
|
2023-09-19 15:39:19 +08:00
|
|
|
|
2023-09-19 16:47:40 +08:00
|
|
|
// 获取用户余额列表
|
|
|
|
public function balance(): Json
|
|
|
|
{
|
|
|
|
//获取参数
|
|
|
|
$params = (new UserBalanceValidate())->get()->goCheck('list');
|
|
|
|
$data = UserLogic::balanceList($params);
|
|
|
|
return $this->success('', $data);
|
|
|
|
}
|
2023-09-19 15:39:19 +08:00
|
|
|
|
2023-09-19 16:47:40 +08:00
|
|
|
// 获取用户积分列表
|
|
|
|
public function integral():Json
|
|
|
|
{
|
|
|
|
//获取参数
|
|
|
|
$params = (new UserIntegralValidate())->get()->goCheck('list');
|
|
|
|
$data = UserLogic::integralList($params);
|
|
|
|
return $this->success('', $data);
|
2023-09-19 15:39:19 +08:00
|
|
|
}
|
2023-09-21 15:31:01 +08:00
|
|
|
|
|
|
|
// 获取应用列表
|
|
|
|
public function apps(): Json
|
|
|
|
{
|
|
|
|
$data = System::field('id as appid,name')->select();
|
|
|
|
return $this->success('请求成功',$data->toArray());
|
|
|
|
}
|
2023-09-18 09:11:13 +08:00
|
|
|
}
|