107 lines
3.4 KiB
PHP
107 lines
3.4 KiB
PHP
<?php
|
||
namespace Yunshop\UseStaff\admin;
|
||
|
||
|
||
use app\common\components\BaseController;
|
||
use app\common\helpers\PaginationHelper;
|
||
use Yunshop\UseStaff\models\ExternalApi;
|
||
use Yunshop\UseStaff\models\UseStaff;
|
||
|
||
class IndexController extends BaseController{
|
||
/**
|
||
* Common: 进入员工管理列表
|
||
* Author: wu-hui
|
||
* Time: 2023/10/09 14:18
|
||
* @return array|string
|
||
* @throws \Throwable
|
||
*/
|
||
public function index(){
|
||
//参数获取
|
||
$pageSize = request()->input('page_size',10);
|
||
$search = request()->input('search');
|
||
// 获取列表信息
|
||
$result = UseStaff::getList($pageSize,$search);
|
||
|
||
$data = [
|
||
'list' => $result['data'],
|
||
'pager' => PaginationHelper::show($result['total'],$result['current_page'],$result['per_page']),
|
||
'search' => $search
|
||
];
|
||
|
||
return view('Yunshop\UseStaff::admin.index.index',$data)->render();
|
||
}
|
||
/**
|
||
* Common: 刷新员工入驻信息
|
||
* Author: wu-hui
|
||
* Time: 2023/10/09 14:31
|
||
* @return mixed
|
||
*/
|
||
public function refreshInfo(){
|
||
try{
|
||
// 参数获取
|
||
$id = request()->input('id');
|
||
// 刷新信息
|
||
$memberInfo = UseStaff::where('id',$id)->first();
|
||
(new ExternalApi())->personnelResult($memberInfo->member_id,$memberInfo->trans_seq_id);
|
||
// 刷新完成
|
||
|
||
return $this->message('刷新成功');
|
||
}catch(\Exception $e){
|
||
return $this->message($e->getMessage());
|
||
}
|
||
}
|
||
|
||
|
||
|
||
|
||
public function test(){
|
||
|
||
// 员工入驻
|
||
// $info = [
|
||
// 'uid' => '228',
|
||
// 'name' => '胡治金',// 账号名称
|
||
// 'tel' => 18982255122,// 手机号
|
||
// 'card_type' => 1,// 卡类型:1=对私,2=对公
|
||
// // 'bank_sub_name' => '',//开户银行支行名称,卡类型为2-对公必填
|
||
// 'account_id_start' => '20201107',// 证件有效期开始时间,格式:YYYYMMDD
|
||
// 'bank_act_name' => '胡治金',// 银行卡持有人姓名
|
||
// 'card_num' => '6217253100008301299',// 银行卡卡号
|
||
// 'account_id' => '511321198404020899',// 银行卡持有人身份证号码
|
||
// 'mer_type' => 3,// 商户类型:1=个体户,3=个人
|
||
// ];
|
||
// (new ExternalApi())->personnelAccess($info);
|
||
// 员工入驻 - 结果查询
|
||
/*$staffInfo = (new ExternalApi())->personnelResult(592217313649454896);
|
||
debug($staffInfo);*/
|
||
// 员工签约
|
||
// $result = (new ExternalApi())->personalContractCreate(592217313649454896);
|
||
// 员工签约状态查询
|
||
// $result = (new ExternalApi())->personalContractQuery(592217313649454896);
|
||
// debug($result);
|
||
// 费用代发接外部订单号(新)
|
||
|
||
|
||
|
||
// $rand = rand(0,50) / 100;
|
||
// if($rand == 0) $rand = 0.1;
|
||
// $info = [
|
||
// 'uid' => '228',
|
||
// 'month' => date("Ym",time()),
|
||
// 'member_id' => '592217313649454896',
|
||
// 'salary' => $rand
|
||
// ];
|
||
// $result = (new ExternalApi())->salaryModelOutOrder($info);
|
||
// debug(['请求结果'=>$result]);
|
||
// // 费用代发 - 结果查询
|
||
// $result = (new ExternalApi())->salaryOutOrderResult('SHB000007570');
|
||
// debug($result);
|
||
|
||
|
||
(new ExternalApi())->test();
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|