update
This commit is contained in:
parent
c2d1310253
commit
61a88e2ea8
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace app\adminapi\controller\financial;
|
||||
|
||||
|
||||
use app\adminapi\controller\BaseAdminController;
|
||||
use app\adminapi\lists\financial\FinancialBidMarginRecoveryLists;
|
||||
use app\adminapi\logic\financial\FinancialBidMarginRecoveryLogic;
|
||||
use app\adminapi\validate\financial\FinancialBidMarginRecoveryValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--投标保证金回收控制器
|
||||
* Class FinancialBidMarginRecoveryController
|
||||
* @package app\adminapi\controller\financial
|
||||
*/
|
||||
class FinancialBidMarginRecoveryController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--投标保证金回收列表
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new FinancialBidMarginRecoveryLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加财务管理--投标保证金回收
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new FinancialBidMarginRecoveryValidate())->post()->goCheck('add');
|
||||
$result = FinancialBidMarginRecoveryLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FinancialBidMarginRecoveryLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑财务管理--投标保证金回收
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new FinancialBidMarginRecoveryValidate())->post()->goCheck('edit');
|
||||
$result = FinancialBidMarginRecoveryLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FinancialBidMarginRecoveryLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除财务管理--投标保证金回收
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new FinancialBidMarginRecoveryValidate())->post()->goCheck('delete');
|
||||
FinancialBidMarginRecoveryLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--投标保证金回收详情
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new FinancialBidMarginRecoveryValidate())->goCheck('detail');
|
||||
$result = FinancialBidMarginRecoveryLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -78,7 +78,7 @@
|
||||
$params = (new MarketingContractRefluxValidate())->post()->goCheck('reflux');
|
||||
Db::startTrans();
|
||||
try {
|
||||
MarketingContractReflux::where('id', $params['id'])->update([
|
||||
MarketingContractReflux::create([
|
||||
'contract_id' => $params['contract_id'],
|
||||
'reflux_date' => !empty($params['reflux_date']) ? strtotime($params['reflux_date']) : 0,
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
|
@ -0,0 +1,97 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\financial;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\financial\FinancialBidMarginRecovery;
|
||||
use app\common\model\GeoCity;
|
||||
use app\common\model\GeoProvince;
|
||||
use app\common\model\marketing\MarketingBusinessOpportunity;
|
||||
use app\common\model\marketing\MarketingCustom;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--投标保证金回收列表
|
||||
* Class FinancialBidMarginRecoveryLists
|
||||
* @package app\adminapi\listsfinancial
|
||||
*/
|
||||
class FinancialBidMarginRecoveryLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['bid_info_id', 'business_opportunity_id', 'part_a', 'agent'],
|
||||
'%like%' => ['cooperate_company'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--投标保证金回收列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
return FinancialBidMarginRecovery::withoutField('update_time,delete_time')->where($this->searchWhere)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($data) {
|
||||
$project = MarketingBusinessOpportunity::field('project_name')->where('id', $data['business_opportunity_id'])->findOrEmpty();
|
||||
$company = MarketingCustom::field('name')->where('id', $data['part_a'])->findOrEmpty();
|
||||
$province = GeoProvince::field('province_name')->where('province_code', $data['province'])->findOrEmpty();
|
||||
$city = GeoCity::field('city_name')->where('city_code', $data['city'])->findOrEmpty();
|
||||
$agent = Admin::field('name')->where('id', $data['agent'])->findOrEmpty();
|
||||
$head_dept = Dept::field('name')->where('id', $data['head_dept'])->findOrEmpty();
|
||||
$data['project_name'] = $project?->project_name;
|
||||
$data['part_a_name'] = $company?->name;
|
||||
$data['province_name'] = $province?->province_name;
|
||||
$data['city_name'] = $city?->city_name;
|
||||
$data['agent_name'] = $agent?->agent_name;
|
||||
$data['head_dept_name'] = $head_dept?->head_dept_name;
|
||||
$data['pay_type_text'] = $data->pay_type_text;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--投标保证金回收数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return FinancialBidMarginRecovery::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
176
app/adminapi/logic/financial/FinancialBidMarginRecoveryLogic.php
Normal file
176
app/adminapi/logic/financial/FinancialBidMarginRecoveryLogic.php
Normal file
@ -0,0 +1,176 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic\financial;
|
||||
|
||||
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\financial\FinancialBidMarginRecovery;
|
||||
use app\common\model\GeoCity;
|
||||
use app\common\model\GeoProvince;
|
||||
use app\common\model\marketing\MarketingBusinessOpportunity;
|
||||
use app\common\model\marketing\MarketingCustom;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--投标保证金回收逻辑
|
||||
* Class FinancialBidMarginRecoveryLogic
|
||||
* @package app\adminapi\logic\financial
|
||||
*/
|
||||
class FinancialBidMarginRecoveryLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加财务管理--投标保证金回收
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
FinancialBidMarginRecovery::create([
|
||||
'bid_info_id' => $params['bid_info_id'],
|
||||
'business_opportunity_id' => $params['business_opportunity_id'],
|
||||
'part_a' => $params['part_a'],
|
||||
'cooperate_company' => $params['cooperate_company'] ?? '',
|
||||
'collection_company' => $params['collection_company'],
|
||||
'collection_account' => $params['collection_account'],
|
||||
'province' => $params['province'] ?? '',
|
||||
'city' => $params['city'] ?? '',
|
||||
'collection_bank' => $params['collection_bank'],
|
||||
'collection_open_bank' => $params['collection_open_bank'],
|
||||
'agent' => $params['agent'],
|
||||
'head_dept' => $params['head_dept'],
|
||||
'bid_margin' => $params['bid_margin'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'end_date' => !empty($params['end_date']) ? strtotime($params['end_date']) : 0,
|
||||
'expected_return_date' => !empty($params['expected_return_date']) ? strtotime($params['expected_return_date']) : 0,
|
||||
'remark' => $params['remark'] ?? '',
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
'pay_amount' => $params['pay_amount'] ?? 0,
|
||||
'pay_date' => !empty($params['pay_date']) ? strtotime($params['pay_date']) : 0,
|
||||
'operator' => $params['operator'] ?? '',
|
||||
'operation_date' => !empty($params['operation_date']) ? strtotime($params['operation_date']) : 0,
|
||||
'recovery_amount' => $params['recovery_amount'],
|
||||
'recovery_date' => !empty($params['recovery_date']) ? strtotime($params['recovery_date']) : 0,
|
||||
'recovery_desc' => $params['recovery_desc'] ?? '',
|
||||
'create_user' => $params['create_user'],
|
||||
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : time(),
|
||||
]);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑财务管理--投标保证金回收
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
FinancialBidMarginRecovery::where('id', $params['id'])->update([
|
||||
'bid_info_id' => $params['bid_info_id'],
|
||||
'business_opportunity_id' => $params['business_opportunity_id'],
|
||||
'part_a' => $params['part_a'],
|
||||
'cooperate_company' => $params['cooperate_company'] ?? '',
|
||||
'collection_company' => $params['collection_company'],
|
||||
'collection_account' => $params['collection_account'],
|
||||
'province' => $params['province'] ?? '',
|
||||
'city' => $params['city'] ?? '',
|
||||
'collection_bank' => $params['collection_bank'],
|
||||
'collection_open_bank' => $params['collection_open_bank'],
|
||||
'agent' => $params['agent'],
|
||||
'head_dept' => $params['head_dept'],
|
||||
'bid_margin' => $params['bid_margin'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'end_date' => !empty($params['end_date']) ? strtotime($params['end_date']) : 0,
|
||||
'expected_return_date' => !empty($params['expected_return_date']) ? strtotime($params['expected_return_date']) : 0,
|
||||
'remark' => $params['remark'] ?? '',
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
'pay_amount' => $params['pay_amount'] ?? 0,
|
||||
'pay_date' => !empty($params['pay_date']) ? strtotime($params['pay_date']) : 0,
|
||||
'operator' => $params['operator'] ?? '',
|
||||
'operation_date' => !empty($params['operation_date']) ? strtotime($params['operation_date']) : 0,
|
||||
'recovery_amount' => $params['recovery_amount'],
|
||||
'recovery_date' => !empty($params['recovery_date']) ? strtotime($params['recovery_date']) : 0,
|
||||
'recovery_desc' => $params['recovery_desc'] ?? '',
|
||||
'create_user' => $params['create_user'],
|
||||
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : time(),
|
||||
]);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::setError($e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除财务管理--投标保证金回收
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return FinancialBidMarginRecovery::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--投标保证金回收详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = FinancialBidMarginRecovery::withoutField('update_time,delete_time')->findOrEmpty($params['id']);
|
||||
$project = MarketingBusinessOpportunity::field('project_name')->where('id', $data['business_opportunity_id'])->findOrEmpty();
|
||||
$company = MarketingCustom::field('name')->where('id', $data['part_a'])->findOrEmpty();
|
||||
$province = GeoProvince::field('province_name')->where('province_code', $data['province'])->findOrEmpty();
|
||||
$city = GeoCity::field('city_name')->where('city_code', $data['city'])->findOrEmpty();
|
||||
$agent = Admin::field('name')->where('id', $data['agent'])->findOrEmpty();
|
||||
$head_dept = Dept::field('name')->where('id', $data['head_dept'])->findOrEmpty();
|
||||
$data['project_name'] = $project?->project_name;
|
||||
$data['part_a_name'] = $company?->name;
|
||||
$data['province_name'] = $province?->province_name;
|
||||
$data['city_name'] = $city?->city_name;
|
||||
$data['agent_name'] = $agent?->agent_name;
|
||||
$data['head_dept_name'] = $head_dept?->head_dept_name;
|
||||
$data['pay_type_text'] = $data->pay_type_text;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -0,0 +1,208 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\validate\financial;
|
||||
|
||||
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\dict\DictData;
|
||||
use app\common\model\financial\FinancialBidMarginRecovery;
|
||||
use app\common\model\GeoCity;
|
||||
use app\common\model\GeoProvince;
|
||||
use app\common\model\marketing\MarketingBidInfo;
|
||||
use app\common\model\marketing\MarketingBusinessOpportunity;
|
||||
use app\common\model\marketing\MarketingCustom;
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--投标保证金回收验证器
|
||||
* Class FinancialBidMarginRecoveryValidate
|
||||
* @package app\adminapi\validate\financial
|
||||
*/
|
||||
class FinancialBidMarginRecoveryValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require|checkData',
|
||||
'bid_info_id' => 'require|checkBidInfo',
|
||||
'business_opportunity_id' => 'require|checkBusinessOpportunity',
|
||||
'part_a' => 'require|checkPartA',
|
||||
'collection_company' => 'require',
|
||||
'collection_account' => 'require',
|
||||
'province' => 'checkProvince',
|
||||
'city' => 'checkCity',
|
||||
'collection_bank' => 'require',
|
||||
'collection_open_bank' => 'require',
|
||||
'agent' => 'require|checkAgent',
|
||||
'head_dept' => 'require|checkHeadDept',
|
||||
'bid_margin' => 'require|float|egt:0',
|
||||
'pay_type' => 'require|checkPayType',
|
||||
'end_date' => 'dateFormat:Y-m-d',
|
||||
'expected_return_date' => 'dateFormat:Y-m-d',
|
||||
'pay_amount' => 'float|egt:0',
|
||||
'pay_date' => 'dateFormat:Y-m-d',
|
||||
'operation_date' => 'dateFormat:Y-m-d',
|
||||
'recovery_amount' => 'require|float|egt:0',
|
||||
'recovery_date' => 'require|dateFormat:Y-m-d',
|
||||
'create_user' => 'require',
|
||||
'create_time' => 'require|dateFormat:Y-m-d H:i:s',
|
||||
'annex' => 'checkAnnex'
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
'bid_info_id' => '投标信息id',
|
||||
'business_opportunity_id' => '业务机会id',
|
||||
'part_a' => '甲方单位',
|
||||
'cooperate_company' => '配合单位',
|
||||
'collection_company' => '收款单位',
|
||||
'collection_account' => '收款账号',
|
||||
'province' => '开户省份',
|
||||
'city' => '开户城市',
|
||||
'collection_bank' => '收款银行',
|
||||
'collection_open_bank' => '收款开户行',
|
||||
'agent' => '经办人',
|
||||
'head_dept' => '负责部门',
|
||||
'bid_margin' => '投标保证金',
|
||||
'pay_type' => '支付方式',
|
||||
'end_date' => '缴纳截止日期',
|
||||
'expected_return_date' => '预计归还日期',
|
||||
'remark' => '备注',
|
||||
'pay_amount' => '支付金额',
|
||||
'pay_date' => '支付时间',
|
||||
'operator' => '操作人',
|
||||
'operation_date' => '操作日期',
|
||||
'recovery_amount' => '回收金额',
|
||||
'recovery_date' => '回收日期',
|
||||
'recovery_desc' => '说明',
|
||||
'create_user' => '申请人',
|
||||
'create_time' => '申请日期',
|
||||
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return FinancialBidMarginRecoveryValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->remove('id', true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return FinancialBidMarginRecoveryValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return FinancialBidMarginRecoveryValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id'])->remove('id', 'checkData');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return FinancialBidMarginRecoveryValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 16:30
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
public function checkData($value): bool|string
|
||||
{
|
||||
$data = FinancialBidMarginRecovery::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '数据不存在' : true;
|
||||
}
|
||||
|
||||
public function checkBidInfo($value): bool|string
|
||||
{
|
||||
$data = MarketingBidInfo::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '投标信息数据不存在' : true;
|
||||
}
|
||||
|
||||
public function checkBusinessOpportunity($value): bool|string
|
||||
{
|
||||
$data = MarketingBusinessOpportunity::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '业务机会数据不存在' : true;
|
||||
}
|
||||
|
||||
public function checkPartA($value): bool|string
|
||||
{
|
||||
$data = MarketingCustom::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '甲方单位数据不存在' : true;
|
||||
}
|
||||
|
||||
public function checkProvince($value): bool|string
|
||||
{
|
||||
if (empty($value)) return true;
|
||||
$data = GeoProvince::where('province_code', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '开户省份信息不存在' : true;
|
||||
}
|
||||
|
||||
public function checkCity($value): bool|string
|
||||
{
|
||||
if (empty($value)) return true;
|
||||
$data = GeoCity::where('city_code', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '开户城市信息不存在' : true;
|
||||
}
|
||||
|
||||
public function checkAgent($value): bool|string
|
||||
{
|
||||
$data = Admin::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '经办人数据不存在' : true;
|
||||
}
|
||||
|
||||
public function checkHeadDept($value): bool|string
|
||||
{
|
||||
$data = Dept::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '负责部门数据不存在' : true;
|
||||
}
|
||||
|
||||
public function checkPayType($value): bool|string
|
||||
{
|
||||
$dict = DictData::where('type_value', 'financial_pay_type')->column('value');
|
||||
return !in_array($value, $dict) ? '支付方式数据值无效' : true;
|
||||
}
|
||||
|
||||
}
|
65
app/common/model/financial/FinancialBidMarginRecovery.php
Normal file
65
app/common/model/financial/FinancialBidMarginRecovery.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\common\model\financial;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\dict\DictData;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--投标保证金回收模型
|
||||
* Class FinancialBidMarginRecovery
|
||||
* @package app\common\model\financial
|
||||
*/
|
||||
class FinancialBidMarginRecovery extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $name = 'financial_bid_margin_recovery';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
public function getPayTypeTextAttr($value, $data)
|
||||
{
|
||||
$dict = DictData::where('type_value', 'financial_pay_type')->column('name', 'value');
|
||||
return !empty($data['pay_type']) ? $dict[$data['pay_type']] : '';
|
||||
}
|
||||
|
||||
public function getEndDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||||
}
|
||||
|
||||
public function getExpectedReturnDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||||
}
|
||||
|
||||
public function getPayDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||||
}
|
||||
|
||||
public function getOperationDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||||
}
|
||||
|
||||
public function getRecoveryDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user