审批操作日志优化
This commit is contained in:
parent
133b2656fa
commit
71ff831afa
@ -301,21 +301,26 @@ class Index extends BaseController
|
|||||||
$id = $param['id'];
|
$id = $param['id'];
|
||||||
$type = $param['type'];
|
$type = $param['type'];
|
||||||
$detail = [];
|
$detail = [];
|
||||||
|
$subject = '一个审批';
|
||||||
if($type==1){
|
if($type==1){
|
||||||
//日常审核
|
//日常审核
|
||||||
$detail = Db::name('Approve')->where(['id' => $id])->find();
|
$detail = Db::name('Approve')->where(['id' => $id])->find();
|
||||||
|
$subject = '一个日常审批';
|
||||||
}
|
}
|
||||||
else if($type==2){
|
else if($type==2){
|
||||||
//报销审核
|
//报销审核
|
||||||
$detail = Db::name('Expense')->where(['id' => $id])->find();
|
$detail = Db::name('Expense')->where(['id' => $id])->find();
|
||||||
|
$subject = '一个报销审批';
|
||||||
}
|
}
|
||||||
else if($type==3){
|
else if($type==3){
|
||||||
//发票审核
|
//发票审核
|
||||||
$detail = Db::name('Invoice')->where(['id' => $id])->find();
|
$detail = Db::name('Invoice')->where(['id' => $id])->find();
|
||||||
|
$subject = '一个发票审批';
|
||||||
}
|
}
|
||||||
else if($type==4){
|
else if($type==4){
|
||||||
//合同审核
|
//合同审核
|
||||||
$detail = Db::name('Contract')->where(['id' => $id])->find();
|
$detail = Db::name('Contract')->where(['id' => $id])->find();
|
||||||
|
$subject = '一个合同审批';
|
||||||
}
|
}
|
||||||
if (empty($detail)){
|
if (empty($detail)){
|
||||||
return to_assign(1,'审批数据错误');
|
return to_assign(1,'审批数据错误');
|
||||||
@ -436,7 +441,7 @@ class Index extends BaseController
|
|||||||
'create_time' => time()
|
'create_time' => time()
|
||||||
);
|
);
|
||||||
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
||||||
add_log('check', $param['id'], $param);
|
add_log('check', $param['id'], $param,$subject);
|
||||||
//发送消息通知
|
//发送消息通知
|
||||||
$msg=[
|
$msg=[
|
||||||
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
||||||
@ -512,7 +517,7 @@ class Index extends BaseController
|
|||||||
'create_time' => time()
|
'create_time' => time()
|
||||||
);
|
);
|
||||||
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
||||||
add_log('refue', $param['id'], $param);
|
add_log('refue', $param['id'], $param,$subject);
|
||||||
//发送消息通知
|
//发送消息通知
|
||||||
$msg=[
|
$msg=[
|
||||||
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
'create_time'=>date('Y-m-d H:i:s',$detail['create_time']),
|
||||||
@ -564,7 +569,7 @@ class Index extends BaseController
|
|||||||
'create_time' => time()
|
'create_time' => time()
|
||||||
);
|
);
|
||||||
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
$aid = Db::name('FlowRecord')->strict(false)->field(true)->insertGetId($checkData);
|
||||||
add_log('back', $param['id'], $param);
|
add_log('back', $param['id'], $param,$subject);
|
||||||
return to_assign();
|
return to_assign();
|
||||||
}else{
|
}else{
|
||||||
return to_assign(1,'操作失败');
|
return to_assign(1,'操作失败');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user