更新报销处理

This commit is contained in:
yaooo 2023-11-03 15:44:33 +08:00
parent 9ad7e6d2f2
commit 074c65e3db
2 changed files with 40 additions and 0 deletions

View File

@ -91,3 +91,16 @@ function get_position_column()
$position = Db::name('Position')->where(['status' => 1])->column('title', 'id');
return $position;
}
//是否是报销打款管理员,count>1即有权限
function isAuthExpense($uid)
{
if($uid == 1){
return 1;
}
$map = [];
$map[] = ['name', '=', 'finance_admin'];
$map[] = ['', 'exp', Db::raw("FIND_IN_SET('{$uid}',uids)")];
$count = Db::name('DataAuth')->where($map)->count();
return $count;
}

View File

@ -499,4 +499,31 @@ class FinanceExpense extends ApiController
$this->apiError('删除失败');
}
}
//报销打款
public function checkedlist()
{
$this->uid = JWT_UID;
$auth = isAuthExpense($this->uid);
if($auth == 0){
$this->apiError('没有权限');
}
$param = get_params();
$where = [];
if (!empty($param['check_status'])) {
$where[] = ['check_status','=',$param['check_status']];
}
else{
$where[] = ['check_status','in',[2,5]];
}
//按时间检索
if (!empty($param['diff_time'])) {
$diff_time =explode('~', $param['diff_time']);
$where[] = ['expense_time', 'between', [strtotime(urldecode($diff_time[0])),strtotime(urldecode($diff_time[1]))]];
}
$model = new ExpenseList;
$list = $model->get_list($param,$where);
$this->apiSuccess($list);
}
}