Compare commits
17 Commits
b5eab3df00
...
80579ffebc
Author | SHA1 | Date |
---|---|---|
|
80579ffebc | |
|
88e9097b53 | |
|
8a7a27fccd | |
|
4cc52dc247 | |
|
1074b433bb | |
|
b13da70dae | |
|
7e34baa0ba | |
|
a9da52bde7 | |
|
c24910342a | |
|
8d757335e3 | |
|
38fc6e4850 | |
|
eb79169226 | |
|
f647466d4b | |
|
83ec214d75 | |
|
b2925f1ab2 | |
|
a768dc5887 | |
|
f30069fbad |
|
@ -43,6 +43,34 @@ class UploadController extends BaseAdminController
|
|||
}
|
||||
}
|
||||
|
||||
//上传图片
|
||||
public function taskImage(): Json
|
||||
{
|
||||
$params=$this->request->post();
|
||||
if (empty($_FILES['file'])) {
|
||||
return $this->fail('请上传图片');
|
||||
}
|
||||
$result = curl_post_file(env('project.worker_domain').'/middleapi/upload/image', $_FILES['file']['tmp_name'], $_FILES['file']['name'], $_FILES['file']['type'],$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//上传文件
|
||||
public function taskFile(): Json
|
||||
{
|
||||
$params=$this->request->post();
|
||||
if (empty($_FILES['file'])) {
|
||||
return $this->fail('请上传图片');
|
||||
}
|
||||
$result = curl_post_file(env('project.worker_domain').'/middleapi/upload/file', $_FILES['file']['tmp_name'], $_FILES['file']['name'], $_FILES['file']['type'],$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 上传视频
|
||||
* @return Json
|
||||
|
|
|
@ -17,6 +17,28 @@
|
|||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//押金凭证列表
|
||||
public function getDepositRechargeTransferVoucherList(): Json
|
||||
{
|
||||
$params=$this->request->get(['page_no','page_size','company_id']);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/company/getDepositRechargeTransferVoucherList',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//上传押金凭证
|
||||
public function depositRechargeTransferVoucher(): Json
|
||||
{
|
||||
$params=$this->request->post(['company_id','deposit','voucher']);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/company/depositRechargeTransferVoucher',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//公司详情
|
||||
public function detail(): Json
|
||||
|
@ -154,4 +176,43 @@
|
|||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//获取甲方公司信息
|
||||
public function getPartyA(): Json
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/company/getPartyA',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//获取公司成员列表
|
||||
public function companyUserLists(): Json
|
||||
{
|
||||
$params = $this->request->get(['company_id','page_no','page_size']);
|
||||
if(empty($params['company_id'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/company/companyUserLists',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//获取公司成员详情
|
||||
public function companyUserDetail(): Json
|
||||
{
|
||||
$params = $this->request->get(['user_id']);
|
||||
if(empty($params['user_id'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/company/companyUserDetail',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
return json($result);
|
||||
}
|
||||
}
|
|
@ -30,7 +30,7 @@ class AccountLogController extends BaseAdminController
|
|||
public function taskLists(): Json
|
||||
{
|
||||
$params = $this->request->get(['company_id', 'type', 'start_time', 'end_time']);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/accountlog/lists',$params,$this->reqHeader);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/account_log/lists',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ class AccountLogController extends BaseAdminController
|
|||
public function getTaskUmChangeType(): Json
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/accountlog/getUmChangeType',$params,$this->reqHeader);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/account_log/getUmChangeType',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ class AccountLogController extends BaseAdminController
|
|||
public function getTaskCompanyUserList(): Json
|
||||
{
|
||||
$params = $this->request->get(['company_id']);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/accountlog/getCompanyUserList',$params,$this->reqHeader);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/account_log/getCompanyUserList',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ class RefundController extends BaseAdminController
|
|||
|
||||
public function taskRecord(): Json
|
||||
{
|
||||
$params=$this->request->get(['user_info', 'start_time', 'end_time', 'sn', 'order_sn']);
|
||||
$params=$this->request->get(['user_info', 'start_time', 'end_time', 'sn', 'order_sn', 'refund_type', 'refund_status']);
|
||||
$result = curl_post(env('project.worker_domain').'/middleapi/refund/record',$params,$this->reqHeader);
|
||||
if($result['code'] == 0){
|
||||
return $this->fail($result['msg']);
|
||||
|
|
|
@ -18,7 +18,7 @@ class UserController extends BaseAdminController
|
|||
{
|
||||
return $this->dataLists(new UserLists());
|
||||
}
|
||||
|
||||
// 供销系统公司负责人
|
||||
public function taskLists(): Json
|
||||
{
|
||||
$params=$this->request->get(['page_no','page_size','company_id', 'account', 'mobile']);
|
||||
|
|
|
@ -12,8 +12,8 @@ class UserLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['status','province','city','area','street','village','brigade'],
|
||||
'%like%' => ['nickname','realname','phone'],
|
||||
'=' => ['status','phone'],
|
||||
'%like%' => ['nickname'],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ use app\common\model\systems\System;
|
|||
use app\common\model\user\User;
|
||||
use app\common\model\user\UserBalance;
|
||||
use app\common\model\user\UserIntegral;
|
||||
use think\facade\Db;
|
||||
|
||||
class UserLogic extends BaseLogic
|
||||
{
|
||||
|
@ -14,24 +15,11 @@ class UserLogic extends BaseLogic
|
|||
public static function detail(int $userId): array
|
||||
{
|
||||
//获取用户信息
|
||||
$field = ['id','phone','avatar','nickname','realname','id_card','gender','age','total_balance','total_integral','province','city','area','street','village','brigade','address','status','last_login_time','last_login_ip','create_time'];
|
||||
$field = ['id','phone','avatar','nickname','realname','status','gender','age','create_time'];
|
||||
$user = User::field($field)->where(['id' => $userId])->findOrEmpty();
|
||||
$user['address'] = $user->province_text.$user->city_text.$user->area_text.$user->street_text.$user->village_text.$user->brigade_text.$user->address;
|
||||
$user['gender_text'] = $user->gender_text;
|
||||
$user['status_text'] = $user->status_text;
|
||||
//获取用户余额列表
|
||||
$user['balance_list'] = UserBalance::field('id,record_id,amount,total_amount,type,pay_type,mark,appid,create_time')->where('user_id',$userId)->limit(10)->order('create_time desc')->select()->each(function($item){
|
||||
$item['app'] = System::where('app_id',$item['appid'])->value('name');
|
||||
$item['type_text'] = $item->type_text;
|
||||
$item['pay_type_text'] = $item->pay_type_text;
|
||||
unset($item['appid']);
|
||||
})->toArray();
|
||||
//获取用户积分列表
|
||||
$user['integral_list'] = UserIntegral::field('id,record_id,amount,total_amount,type,mark,appid,create_time')->where('user_id',$userId)->limit(10)->order('create_time desc')->select()->each(function($item){
|
||||
$item['app'] = System::where('app_id',$item['appid'])->value('name');
|
||||
$item['type_text'] = $item->type_text;
|
||||
})->toArray();
|
||||
unset($user['province'],$user['city'],$user['area'],$user['street'],$user['village'],$user['brigade']);
|
||||
$user['app_list'] = Db::name('system_user')->alias('su')->leftJoin('dc_system s','su.app_id = s.app_id')->field(['s.id', 's.app_id', 's.name'])->select();
|
||||
return $user->toArray();
|
||||
}
|
||||
|
||||
|
|
|
@ -337,7 +337,12 @@ function curl_post($url,$data,$headers=[]) {
|
|||
//设置为post方式请求
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
//添加参数
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
if (is_array($data)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
|
||||
}
|
||||
if (is_string($data)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
}
|
||||
//设置header
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
//关闭请求资源
|
||||
|
@ -345,6 +350,25 @@ function curl_post($url,$data,$headers=[]) {
|
|||
curl_close($ch);
|
||||
return json_decode($output,true);
|
||||
}
|
||||
|
||||
function curl_post_file($url, $filePath, $fieldName, $fieldExt, $headers=[]) {
|
||||
//初始化curl
|
||||
$ch = curl_init($url);
|
||||
$cfile = curl_file_create($filePath, $fieldExt, $fieldName);
|
||||
// 设置 POST 数据
|
||||
$data = array('file' => $cfile);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_POST,1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
|
||||
|
||||
$output = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return json_decode($output,true);
|
||||
}
|
||||
|
||||
function curl_get($url){
|
||||
$ch = curl_init();
|
||||
|
|
Loading…
Reference in New Issue