update
This commit is contained in:
parent
61a88e2ea8
commit
8fcd1c6f9f
@ -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\FinancialPerformanceMoneyApplyLists;
|
||||
use app\adminapi\logic\financial\FinancialPerformanceMoneyApplyLogic;
|
||||
use app\adminapi\validate\financial\FinancialPerformanceMoneyApplyValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--履约金申请控制器
|
||||
* Class FinancialPerformanceMoneyApplyController
|
||||
* @package app\adminapi\controller\financial
|
||||
*/
|
||||
class FinancialPerformanceMoneyApplyController extends BaseAdminController
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--履约金申请列表
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists(new FinancialPerformanceMoneyApplyLists());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加财务管理--履约金申请
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$params = (new FinancialPerformanceMoneyApplyValidate())->post()->goCheck('add');
|
||||
$result = FinancialPerformanceMoneyApplyLogic::add($params);
|
||||
if (true === $result) {
|
||||
return $this->success('添加成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FinancialPerformanceMoneyApplyLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑财务管理--履约金申请
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$params = (new FinancialPerformanceMoneyApplyValidate())->post()->goCheck('edit');
|
||||
$result = FinancialPerformanceMoneyApplyLogic::edit($params);
|
||||
if (true === $result) {
|
||||
return $this->success('编辑成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(FinancialPerformanceMoneyApplyLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除财务管理--履约金申请
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$params = (new FinancialPerformanceMoneyApplyValidate())->post()->goCheck('delete');
|
||||
FinancialPerformanceMoneyApplyLogic::delete($params);
|
||||
return $this->success('删除成功', [], 1, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--履约金申请详情
|
||||
* @return \think\response\Json
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$params = (new FinancialPerformanceMoneyApplyValidate())->goCheck('detail');
|
||||
$result = FinancialPerformanceMoneyApplyLogic::detail($params);
|
||||
return $this->data($result);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
<?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\FinancialPerformanceMoneyApply;
|
||||
use app\common\model\GeoCity;
|
||||
use app\common\model\GeoProvince;
|
||||
use app\common\model\marketing\MarketingContract;
|
||||
use app\common\model\marketing\MarketingCustom;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--履约金申请列表
|
||||
* Class FinancialPerformanceMoneyApplyLists
|
||||
* @package app\adminapi\listsfinancial
|
||||
*/
|
||||
class FinancialPerformanceMoneyApplyLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 设置搜索条件
|
||||
* @return \string[][]
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['contract_id'],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--履约金申请列表
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function lists(): array
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$where = [];
|
||||
if (!empty($params['payment_date'])) {
|
||||
$date = explode(',', $params['payment_date']);
|
||||
$where[] = ['payment_date', 'between', [strtotime($date[0] . ' 00:00:00'), strtotime($date[1] . ' 23:59:59')]];
|
||||
}
|
||||
return FinancialPerformanceMoneyApply::withoutField('update_time,delete_time')->where($this->searchWhere)->where($where)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function ($data) {
|
||||
$contract = MarketingContract::field('contract_name,part_a,signed_amount,performance_money,performance_money_expiration_time,signed_dept,project_manager')->where('id', $data['contract_id'])->findOrEmpty();
|
||||
$part_a = MarketingCustom::field('name')->where('id', $contract['part_a'])->findOrEmpty();
|
||||
$signed_dept = Dept::field('name')->where('id', $contract['signed_dept'])->findOrEmpty();
|
||||
$project_manager = Admin::field('name')->where('id', $contract['project_manager'])->findOrEmpty();
|
||||
$province = GeoProvince::field('province_name')->where('province_code', $data['province'])->findOrEmpty();
|
||||
$city = GeoCity::field('city_name')->where('city_code', $data['city'])->findOrEmpty();
|
||||
$pay_user = Admin::field('name')->where('id', $data['pay_user'])->findOrEmpty();
|
||||
$data['contract_name'] = $contract?->contract_name;
|
||||
$data['part_a'] = $part_a?->name;
|
||||
$data['signed_amount'] = $contract?->signed_amount;
|
||||
$data['performance_money'] = $contract?->performance_money;
|
||||
$data['performance_money_expiration_time'] = $contract?->performance_money_expiration_time;
|
||||
$data['signed_dept'] = $signed_dept?->name;
|
||||
$data['project_manager'] = $project_manager?->name;
|
||||
$data['province_name'] = $province?->province_name;
|
||||
$data['city_name'] = $city?->city_name;
|
||||
$data['pay_type_text'] = $data->pay_type_text;
|
||||
$data['pay_user_name'] = $pay_user?->name;
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--履约金申请数量
|
||||
* @return int
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
$params = $this->request->get();
|
||||
$where = [];
|
||||
if (!empty($params['payment_date'])) {
|
||||
$date = explode(',', $params['payment_date']);
|
||||
$where[] = ['payment_date', 'between', [strtotime($date[0] . ' 00:00:00'), strtotime($date[1] . ' 23:59:59')]];
|
||||
}
|
||||
return FinancialPerformanceMoneyApply::where($this->searchWhere)->where($where)->count();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,165 @@
|
||||
<?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\FinancialPerformanceMoneyApply;
|
||||
use app\common\model\GeoCity;
|
||||
use app\common\model\GeoProvince;
|
||||
use app\common\model\marketing\MarketingContract;
|
||||
use app\common\model\marketing\MarketingCustom;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--履约金申请逻辑
|
||||
* Class FinancialPerformanceMoneyApplyLogic
|
||||
* @package app\adminapi\logic\financial
|
||||
*/
|
||||
class FinancialPerformanceMoneyApplyLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加财务管理--履约金申请
|
||||
* @param array $params
|
||||
* @return bool
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public static function add(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
FinancialPerformanceMoneyApply::create([
|
||||
'contract_id' => $params['contract_id'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'payment_date' => !empty($params['payment_date']) ? strtotime($params['payment_date']) : 0,
|
||||
'apply_amount' => $params['apply_amount'],
|
||||
'collection_company' => $params['collection_company'],
|
||||
'collection_account' => $params['collection_account'],
|
||||
'collection_bank' => $params['collection_bank'],
|
||||
'collection_open_bank' => $params['collection_open_bank'],
|
||||
'province' => $params['province'] ?? '',
|
||||
'city' => $params['city'] ?? '',
|
||||
'pay_user' => $params['pay_user'] ?? 0,
|
||||
'pay_account' => $params['pay_account'] ?? '',
|
||||
'pay_amount' => $params['pay_amount'] ?? 0,
|
||||
'pay_date' => !empty($params['pay_date']) ? strtotime($params['pay_date']) : 0,
|
||||
'remark' => $params['remark'] ?? '',
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
'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 17:24
|
||||
*/
|
||||
public static function edit(array $params): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
FinancialPerformanceMoneyApply::where('id', $params['id'])->update([
|
||||
'contract_id' => $params['contract_id'],
|
||||
'pay_type' => $params['pay_type'],
|
||||
'payment_date' => !empty($params['payment_date']) ? strtotime($params['payment_date']) : 0,
|
||||
'apply_amount' => $params['apply_amount'],
|
||||
'collection_company' => $params['collection_company'],
|
||||
'collection_account' => $params['collection_account'],
|
||||
'collection_bank' => $params['collection_bank'],
|
||||
'collection_open_bank' => $params['collection_open_bank'],
|
||||
'province' => $params['province'] ?? '',
|
||||
'city' => $params['city'] ?? '',
|
||||
'pay_user' => $params['pay_user'] ?? 0,
|
||||
'pay_account' => $params['pay_account'] ?? '',
|
||||
'pay_amount' => $params['pay_amount'] ?? 0,
|
||||
'pay_date' => !empty($params['pay_date']) ? strtotime($params['pay_date']) : 0,
|
||||
'remark' => $params['remark'] ?? '',
|
||||
'annex' => $params['annex'] ? json_encode($params['annex']) : null,
|
||||
'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 17:24
|
||||
*/
|
||||
public static function delete(array $params): bool
|
||||
{
|
||||
return FinancialPerformanceMoneyApply::destroy($params['id']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 获取财务管理--履约金申请详情
|
||||
* @param $params
|
||||
* @return array
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = FinancialPerformanceMoneyApply::withoutField('update_time,delete_time')->findOrEmpty($params['id']);
|
||||
$contract = MarketingContract::field('contract_name,part_a,signed_amount,performance_money,performance_money_expiration_time,signed_dept,project_manager')->where('id', $data['contract_id'])->findOrEmpty();
|
||||
$part_a = MarketingCustom::field('name')->where('id', $contract['part_a'])->findOrEmpty();
|
||||
$signed_dept = Dept::field('name')->where('id', $contract['signed_dept'])->findOrEmpty();
|
||||
$project_manager = Admin::field('name')->where('id', $contract['project_manager'])->findOrEmpty();
|
||||
$province = GeoProvince::field('province_name')->where('province_code', $data['province'])->findOrEmpty();
|
||||
$city = GeoCity::field('city_name')->where('city_code', $data['city'])->findOrEmpty();
|
||||
$pay_user = Admin::field('name')->where('id', $data['pay_user'])->findOrEmpty();
|
||||
$data['contract_name'] = $contract?->contract_name;
|
||||
$data['part_a'] = $part_a?->name;
|
||||
$data['signed_amount'] = $contract?->signed_amount;
|
||||
$data['performance_money'] = $contract?->performance_money;
|
||||
$data['performance_money_expiration_time'] = $contract?->performance_money_expiration_time;
|
||||
$data['signed_dept'] = $signed_dept?->name;
|
||||
$data['project_manager'] = $project_manager?->name;
|
||||
$data['province_name'] = $province?->province_name;
|
||||
$data['city_name'] = $city?->city_name;
|
||||
$data['pay_type_text'] = $data->pay_type_text;
|
||||
$data['pay_user_name'] = $pay_user?->name;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
<?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\dict\DictData;
|
||||
use app\common\model\financial\FinancialPerformanceMoneyApply;
|
||||
use app\common\model\GeoCity;
|
||||
use app\common\model\GeoProvince;
|
||||
use app\common\model\marketing\MarketingContract;
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
* 财务管理--履约金申请验证器
|
||||
* Class FinancialPerformanceMoneyApplyValidate
|
||||
* @package app\adminapi\validate\financial
|
||||
*/
|
||||
class FinancialPerformanceMoneyApplyValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require|checkData',
|
||||
'contract_id' => 'require|checkContract',
|
||||
'pay_type' => 'require|checkPayType',
|
||||
'payment_date' => 'require|dateFormat:Y-m-d',
|
||||
'apply_amount' => 'require|float|egt:0',
|
||||
'collection_company' => 'require',
|
||||
'collection_account' => 'require',
|
||||
'collection_bank' => 'require',
|
||||
'collection_open_bank' => 'require',
|
||||
'province' => 'checkProvince',
|
||||
'city' => 'checkCity',
|
||||
'pay_user' => 'checkPayUser',
|
||||
'pay_amount' => 'float|egt:0',
|
||||
'pay_date' => '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',
|
||||
'contract_id' => '合同id',
|
||||
'pay_type' => '支付方式',
|
||||
'payment_date' => '要求交款日期',
|
||||
'apply_amount' => '申请金额',
|
||||
'collection_company' => '收款单位',
|
||||
'collection_account' => '收款账号',
|
||||
'collection_bank' => '收款银行',
|
||||
'collection_open_bank' => '收款开户行',
|
||||
'province' => '开户省份',
|
||||
'city' => '开户市区',
|
||||
'pay_user' => '支付人',
|
||||
'pay_account' => '付款账号',
|
||||
'pay_amount' => '支付金额',
|
||||
'pay_date' => '支付日期',
|
||||
'remark' => '备注',
|
||||
'create_user' => '申请人',
|
||||
'create_time' => '申请日期',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return FinancialPerformanceMoneyApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->remove('id', true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 编辑场景
|
||||
* @return FinancialPerformanceMoneyApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 删除场景
|
||||
* @return FinancialPerformanceMoneyApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function sceneDelete()
|
||||
{
|
||||
return $this->only(['id'])->remove('id', 'checkData');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 详情场景
|
||||
* @return FinancialPerformanceMoneyApplyValidate
|
||||
* @author likeadmin
|
||||
* @date 2024/04/13 17:24
|
||||
*/
|
||||
public function sceneDetail()
|
||||
{
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
public function checkData($value): bool|string
|
||||
{
|
||||
$data = FinancialPerformanceMoneyApply::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '数据不存在' : true;
|
||||
}
|
||||
|
||||
public function checkContract($value): bool|string
|
||||
{
|
||||
$data = MarketingContract::where('id', $value)->where('contract_type', 0)->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;
|
||||
}
|
||||
|
||||
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 checkPayUser($value): bool|string
|
||||
{
|
||||
$data = Admin::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '支付人数据不存在' : true;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
<?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 FinancialPerformanceMoneyApply
|
||||
* @package app\common\model\financial
|
||||
*/
|
||||
class FinancialPerformanceMoneyApply extends BaseModel
|
||||
{
|
||||
use SoftDelete;
|
||||
|
||||
protected $name = 'financial_performance_money_apply';
|
||||
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 getPaymentDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||||
}
|
||||
|
||||
public function getPayDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d', $value) : '';
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user