This commit is contained in:
weiz 2024-03-25 10:14:04 +08:00
parent ab2a6931bb
commit 4aa0d392ef
3 changed files with 235 additions and 212 deletions

View File

@ -42,4 +42,11 @@ class ProjectSalaryDetailController extends BaseAdminController
return $this->dataLists(new ProjectSalaryDetailLists());
}
public function delete()
{
$params = (new ProjectSalaryDetailValidate())->post()->goCheck('delete');
ProjectSalaryDetailLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
}

View File

@ -59,7 +59,8 @@ class ProjectSalaryPaymentController extends BaseAdminController
return $this->fail(ProjectSalaryPaymentLogic::getError());
}
public function edit() {
public function edit()
{
$params = (new ProjectSalaryPaymentValidate())->post()->goCheck('edit');
$result = ProjectSalaryPaymentLogic::edit($params);
if (true === $result) {
@ -68,6 +69,16 @@ class ProjectSalaryPaymentController extends BaseAdminController
return $this->fail(ProjectSalaryPaymentLogic::getError());
}
public function delete()
{
$params = (new ProjectSalaryPaymentValidate())->post()->goCheck('delete');
$result = ProjectSalaryPaymentLogic::delete($params);
if (true === $result) {
return $this->success('删除成功', [], 1, 1);
}
return $this->fail(ProjectSalaryPaymentLogic::getError());
}
/**
* @notes 获取工资付款详情

View File

@ -15,15 +15,10 @@
namespace app\adminapi\logic\project;
use app\common\model\build\BuildPlan;
use app\common\model\build\BuildReport;
use app\common\model\build\BuildReportDetail;
use app\common\logic\BaseLogic;
use app\common\model\project\Project;
use app\common\model\project\ProjectAttendanceDetail;
use app\common\model\project\ProjectPersonnel;
use app\common\model\project\ProjectSalaryDetail;
use app\common\model\project\ProjectSalaryPayment;
use app\common\logic\BaseLogic;
use think\facade\Db;
@ -113,6 +108,16 @@ class ProjectSalaryPaymentLogic extends BaseLogic
}
}
public static function delete(array $params): bool
{
$detail = ProjectSalaryDetail::where('salary_payment_id', 'in', $params['id'])->findOrEmpty();
if (!$detail->isEmpty()) {
self::setError('此数据关联了工资明细内容,需删除工资明细内容');
return false;
}
return ProjectSalaryPayment::destroy($params['id']);
}
/**
* @notes 获取工资付款详情