智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

118 lines
3.3 KiB

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\salary;
use core\base\BaseAdminController;
use app\service\admin\salary\SalaryService;
/**
* 工资控制器
* Class Salary
* @package app\adminapi\controller\salary
*/
class Salary extends BaseAdminController
{
/**
* 获取工资列表
* @return \think\Response
*/
public function lists(){
$data = $this->request->params([
["staff_id",""],
["base_salary",""],
["performance_bonus",""],
["deductions",""],
["other_subsidies",""],
["net_salary",""],
["payment_status",""],
["payment_method",""],
["remarks",""],
["salary_month",""],
["department_id",""],
["process_id",""]
]);
return success((new SalaryService())->getPage($data));
}
/**
* 工资详情
* @param int $id
* @return \think\Response
*/
public function info(int $id){
return success((new SalaryService())->getInfo($id));
}
/**
* 添加工资
* @return \think\Response
*/
public function add(){
$data = $this->request->params([
["staff_id",0],
["base_salary",0.00],
["performance_bonus",0.00],
["deductions",0.00],
["other_subsidies",0.00],
["net_salary",0.00],
["payment_status",""],
["payment_method",""],
["remarks",""],
["salary_month","2025-05-16 17:53:32"],
["department_id",0],
["process_id",0],
]);
$this->validate($data, 'app\validate\salary\Salary.add');
$id = (new SalaryService())->add($data);
return success('ADD_SUCCESS', ['id' => $id]);
}
/**
* 工资编辑
* @param $id 工资id
* @return \think\Response
*/
public function edit(int $id){
$data = $this->request->params([
["staff_id",0],
["base_salary",0.00],
["performance_bonus",0.00],
["deductions",0.00],
["other_subsidies",0.00],
["net_salary",0.00],
["payment_status",""],
["payment_method",""],
["remarks",""],
["salary_month","2025-05-16 17:53:32"],
["department_id",0],
["process_id",0],
]);
$this->validate($data, 'app\validate\salary\Salary.edit');
(new SalaryService())->edit($id, $data);
return success('EDIT_SUCCESS');
}
/**
* 工资删除
* @param $id 工资id
* @return \think\Response
*/
public function del(int $id){
(new SalaryService())->del($id);
return success('DELETE_SUCCESS');
}
}