add:押金充值对公账户临时方案
This commit is contained in:
parent
22ed2105fb
commit
eb5607bfe4
@ -523,4 +523,33 @@ class CompanyController extends BaseAdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPartyA()
|
||||||
|
{
|
||||||
|
$companyId = $this->request->param('company_id');
|
||||||
|
$re = CompanyLogic::getPartyA($companyId);
|
||||||
|
if ($re === false) {
|
||||||
|
return $this->fail(CompanyLogic::getError());
|
||||||
|
}
|
||||||
|
return $this->success('成功', $re);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDepositRechargeTransferVoucherList()
|
||||||
|
{
|
||||||
|
$companyId = $this->request->param('company_id');
|
||||||
|
$list = CompanyDepositVoucher::where(['company_id' => $companyId])->select()->toArray();
|
||||||
|
return $this->success('成功',$list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function depositRechargeTransferVoucherDetail()
|
||||||
|
{
|
||||||
|
$param = $this->request->param();
|
||||||
|
$companyDepositVoucher = CompanyDepositVoucher::where(['id' => $param['id']])->findOrEmpty()->toArray();
|
||||||
|
if (empty($companyDepositVoucher)) {
|
||||||
|
return $this->fail('数据不存在');
|
||||||
|
}
|
||||||
|
$contract = Contract::where(['party_b'=>$companyDepositVoucher['company_id']])->with(['partyA', 'partyB'])->findOrEmpty()->toArray();
|
||||||
|
return $this->success('成功', array_merge($companyDepositVoucher, $contract));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace app\api\controller;
|
namespace app\api\controller;
|
||||||
|
|
||||||
|
use app\common\logic\CompanyLogic;
|
||||||
use app\common\logic\contract\ContractLogic;
|
use app\common\logic\contract\ContractLogic;
|
||||||
use app\common\model\auth\Admin;
|
use app\common\model\auth\Admin;
|
||||||
use app\common\model\Company;
|
use app\common\model\Company;
|
||||||
@ -366,12 +367,10 @@ class CompanyController extends BaseApiController
|
|||||||
*/
|
*/
|
||||||
public function getPartyACompany()
|
public function getPartyACompany()
|
||||||
{
|
{
|
||||||
$company = Company::where(['id'=>$this->userInfo['company_id']])->find();
|
$re = CompanyLogic::getPartyA($this->userInfo['company_id']);
|
||||||
$contract = Contract::where(['party_b'=>$company['id']])->find();
|
if ($re === false) {
|
||||||
if ($contract) {
|
return $this->fail(CompanyLogic::getError());
|
||||||
$partyA = Company::where(['id'=>$contract['party_a']])->find();
|
|
||||||
return $this->success('ok', $partyA);
|
|
||||||
}
|
}
|
||||||
return $this->fail('当前公司未签约甲方公司');
|
return $this->success('成功',$re);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -425,4 +425,17 @@ class CompanyLogic extends BaseLogic
|
|||||||
$model->save();
|
$model->save();
|
||||||
return $model->id;
|
return $model->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getPartyA($companyId)
|
||||||
|
{
|
||||||
|
$company = Company::where(['id' => $companyId])->find();
|
||||||
|
$contract = Contract::where(['party_b'=>$company['id']])->find();
|
||||||
|
if ($contract) {
|
||||||
|
$partyA = Company::where(['id'=>$contract['party_a']])->find()->toArray();
|
||||||
|
return $partyA;
|
||||||
|
} else {
|
||||||
|
self::setError("该公司未与上级公司签约,无法充值押金");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user