更新
This commit is contained in:
parent
1cf424c9d7
commit
0ac2c151d4
@ -157,7 +157,7 @@ class AdminController extends BaseAdminController
|
||||
$result = AdminLogic::detail($params);
|
||||
if ($result && $result['contract'] && $result['contract']['file'] != '') {
|
||||
$data = [
|
||||
'name' => $result['name'] . '的个人合同',
|
||||
'name' => $result['name'] . '合同',
|
||||
'signatories' => [['fullName' => $result['name'], 'identityType' => 1, 'identityCard' => $result['id_card'], 'mobile' => $result['account'], 'noNeedVerify' => 1, 'signLevel' => 1]],
|
||||
'url' => $result['contract']['file']
|
||||
];
|
||||
|
@ -5,6 +5,7 @@ namespace app\api\controller;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\Company;
|
||||
use app\common\model\contract\Contract;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
@ -35,13 +36,22 @@ class ContractController extends BaseApiController
|
||||
if (empty($contract)) {
|
||||
return $this->fail('合同不存在');
|
||||
}
|
||||
if($contract['admin_id']!=0){
|
||||
$contract['party_b_name'] = Admin::where('id', $contract['admin_id'])->value('name');
|
||||
}else{
|
||||
$contract['party_b_name'] = Db::name('company')->where('id', $contract['party_b'])->value('company_name');
|
||||
}
|
||||
$contract['party_a_name'] = Db::name('company')->where('id', $contract['party_a'])->value('company_name');
|
||||
|
||||
$contract['contract_type_name'] = Db::name('dict_data')->where('id', $contract['contract_type'])->value('name');
|
||||
$company = Company::where('id', $contract['company_id'])->find();
|
||||
$company['company_type_name'] = Db::name('dict_data')->where('id', $contract['company_type'])->value('name');
|
||||
$company['other_contacts'] = json_decode($company['other_contacts'], true);
|
||||
$company['qualification'] = json_decode($company['qualification'], true);
|
||||
$company['qualification'] = $company['qualification']!=null?json_decode($company['qualification'], true):'';
|
||||
$users = Admin::where('company_id', $company['id'])->field('id,name,account,phone,qualification')->select()->toArray();
|
||||
foreach ($users as &$user) {
|
||||
$user['is_main'] = $user['id'] == $company['admin_id'] ? 1 : 0;
|
||||
$user['qualification'] = json_decode($user['qualification'], true);
|
||||
$user['qualification'] =$user['qualification']!=null?json_decode($user['qualification'], true):[];
|
||||
unset($user['role_id'], $user['dept_id'], $user['jobs_id'], $user['id']);
|
||||
}
|
||||
return $this->success('success', ['contract' => $contract, 'company' => $company, 'users' => $users], 1, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user