Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
29ed839407
@ -11,6 +11,7 @@
|
|||||||
use app\common\logic\RedisLogic;
|
use app\common\logic\RedisLogic;
|
||||||
use app\common\model\auth\Admin;
|
use app\common\model\auth\Admin;
|
||||||
use app\common\model\Company;
|
use app\common\model\Company;
|
||||||
|
use app\common\model\company\CompanyAccountLog;
|
||||||
use app\common\model\contract\Contract;
|
use app\common\model\contract\Contract;
|
||||||
use app\common\model\dict\DictData;
|
use app\common\model\dict\DictData;
|
||||||
use app\common\model\task_scheduling\TaskScheduling;
|
use app\common\model\task_scheduling\TaskScheduling;
|
||||||
@ -356,4 +357,62 @@
|
|||||||
];
|
];
|
||||||
return $this->success('请求成功',$result);
|
return $this->success('请求成功',$result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function depositRechargeTransferVoucher()
|
||||||
|
{
|
||||||
|
if(!$this->request->isPost()){
|
||||||
|
return $this->fail('请求方式错误');
|
||||||
|
}
|
||||||
|
$param = $this->request->param();
|
||||||
|
if(empty($param['company_id'])){
|
||||||
|
return $this->fail('缺少company_id');
|
||||||
|
}
|
||||||
|
if(empty($param['deposit'])){
|
||||||
|
return $this->fail('缺少押金金额');
|
||||||
|
}
|
||||||
|
if(empty($param['voucher'])){
|
||||||
|
return $this->fail('缺少凭证文件');
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
$adminId = 1;
|
||||||
|
Db::startTrans();
|
||||||
|
$data = [
|
||||||
|
'company_id' => $param['company_id'],
|
||||||
|
'deposit' => $param['deposit'],
|
||||||
|
'voucher' => $param['voucher'],
|
||||||
|
'create_admin_id' => $adminId,
|
||||||
|
'create_time' => time(),
|
||||||
|
'update_time' => time()
|
||||||
|
];
|
||||||
|
$result = (new CompanyDepositVoucher())->save($data);
|
||||||
|
|
||||||
|
$companyModel = Company::where(['id' => $param['company_id']])->find();
|
||||||
|
$left_amount = bcadd($companyModel['deposit'], $param['deposit'], 2);
|
||||||
|
|
||||||
|
// 添加流水记录
|
||||||
|
$datas = [
|
||||||
|
'sn' => generate_sn(CompanyAccountLog::class, 'sn', 20),
|
||||||
|
'user_id' => 0,
|
||||||
|
'company_id' => $param['company_id'],
|
||||||
|
'change_type' => CompanyAccountLog::COMPANY_DEPOSIT,
|
||||||
|
'change_object' => CompanyAccountLog::DEPOSIT,
|
||||||
|
'action' => 1,
|
||||||
|
'change_amount' => $param['deposit'],
|
||||||
|
'left_amount' =>$left_amount,
|
||||||
|
'remark' => '后台押金转账凭证充值',
|
||||||
|
'status' => 1,
|
||||||
|
];
|
||||||
|
CompanyAccountLog::create($datas);
|
||||||
|
|
||||||
|
// 更新公司押金金额
|
||||||
|
$companyModel->deposit = $left_amount;
|
||||||
|
$companyModel->save();
|
||||||
|
Db::commit();
|
||||||
|
return $this->success('成功');
|
||||||
|
} catch (Exception $exception) {
|
||||||
|
Db::rollback();
|
||||||
|
return $this->fail($exception->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
@ -24,10 +24,10 @@
|
|||||||
}
|
}
|
||||||
$params = $this->request->post(['page_no','page_size','contract_no','contract_type','contract_status','company_name','area_manager']);
|
$params = $this->request->post(['page_no','page_size','contract_no','contract_type','contract_status','company_name','area_manager']);
|
||||||
$where = [];
|
$where = [];
|
||||||
if(isset($params['contract_no'])){
|
if(isset($params['contract_no']) && $params['contract_no']!=''){
|
||||||
$where[] = ['contract_no','like','%'.$params['contract_no'].'%'];
|
$where[] = ['contract_no','like','%'.$params['contract_no'].'%'];
|
||||||
}
|
}
|
||||||
if(isset($params['contract_type'])){
|
if(isset($params['contract_type']) && $params['contract_type']!=''){
|
||||||
$where[] = ['contract_type','=',$params['contract_type']];
|
$where[] = ['contract_type','=',$params['contract_type']];
|
||||||
}
|
}
|
||||||
if(isset($params['contract_status']) && in_array($params['contract_status'],[0,1])){
|
if(isset($params['contract_status']) && in_array($params['contract_status'],[0,1])){
|
||||||
|
46
app/middleapi/controller/UploadController.php
Normal file
46
app/middleapi/controller/UploadController.php
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\middleapi\controller;
|
||||||
|
|
||||||
|
use app\common\service\UploadService;
|
||||||
|
use Exception;
|
||||||
|
use app\common\controller\BaseLikeAdminController;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典数据
|
||||||
|
* Class DictDataController
|
||||||
|
* @package app\adminapi\controller\dictionary
|
||||||
|
*/
|
||||||
|
class UploadController extends BaseLikeAdminController
|
||||||
|
{
|
||||||
|
|
||||||
|
public function image()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$cid = $this->request->post('cid', 0);
|
||||||
|
$result = UploadService::image($cid);
|
||||||
|
return $this->success('上传成功', $result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return $this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @notes 上传文件
|
||||||
|
* @return Json
|
||||||
|
* @author 段誉
|
||||||
|
* @date 2021/12/29 16:27
|
||||||
|
*/
|
||||||
|
public function file()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$cid = $this->request->post('cid', 0);
|
||||||
|
$result = UploadService::file($cid);
|
||||||
|
return $this->success('上传成功', $result);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
return $this->fail($e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user