diff --git a/app/api/controller/FinanceExpense.php b/app/api/controller/FinanceExpense.php index f05386b..862ca80 100644 --- a/app/api/controller/FinanceExpense.php +++ b/app/api/controller/FinanceExpense.php @@ -145,7 +145,7 @@ class FinanceExpense extends ApiController $flow_list = Db::name('Flow')->where('id',$param['flow_id'])->value('flow_list'); $flow = unserialize($flow_list); - if (!empty($param['check_admin_ids'])) { + if (empty($param['check_admin_ids'])) { foreach($flow as $item) { // 当前部门负责人 if ($item['flow_type'] == 1) { @@ -190,7 +190,7 @@ class FinanceExpense extends ApiController //删除原来的审核流程和审核记录 Db::name('FlowStep')->where(['action_id'=>$param['id'],'type'=>2,'delete_time'=>0])->update(['delete_time'=>time()]); Db::name('FlowRecord')->where(['action_id'=>$param['id'],'type'=>2,'delete_time'=>0])->update(['delete_time'=>time()]); - if (!empty($param['check_admin_ids'])) { + if (empty($param['check_admin_ids'])) { if($flow[0]['flow_type'] == 1){ // 部门负责人 $manager = get_department_manager($this->uid); @@ -300,7 +300,7 @@ class FinanceExpense extends ApiController $param['did'] = $this->did; Db::startTrans(); try { - if (!empty($param['check_admin_ids'])) { + if (empty($param['check_admin_ids'])) { if($flow[0]['flow_type'] == 1){ // 部门负责人 $manager = get_department_manager($this->uid); diff --git a/app/api/controller/FinanceInvoice.php b/app/api/controller/FinanceInvoice.php index 225829c..5d469f9 100644 --- a/app/api/controller/FinanceInvoice.php +++ b/app/api/controller/FinanceInvoice.php @@ -173,7 +173,7 @@ class FinanceInvoice extends ApiController $this->apiError("银行地址不能为空"); } } - if (!empty($param['check_admin_ids'])) { + if (empty($param['check_admin_ids'])) { foreach($flow as $item) { // 当前部门负责人 if ($item['flow_type'] == 1) { @@ -216,7 +216,7 @@ class FinanceInvoice extends ApiController //删除原来的审核流程和审核记录 Db::name('FlowStep')->where(['action_id'=>$param['id'],'type'=>3,'delete_time'=>0])->update(['delete_time'=>time()]); Db::name('FlowRecord')->where(['action_id'=>$param['id'],'type'=>3,'delete_time'=>0])->update(['delete_time'=>time()]); - if (!empty($param['check_admin_ids'])) { + if (empty($param['check_admin_ids'])) { if($flow[0]['flow_type'] == 1){ // 部门负责人 $manager = get_department_manager($this->uid); @@ -295,7 +295,7 @@ class FinanceInvoice extends ApiController $param['did'] = $this->did; $param['create_time'] = time(); - if (!empty($param['check_admin_ids'])) { + if (empty($param['check_admin_ids'])) { if($flow[0]['flow_type'] == 1){ // 部门负责人 $manager = get_department_manager($this->uid); diff --git a/app/api/controller/OaApprove.php b/app/api/controller/OaApprove.php index 8ed469b..247e7bb 100644 --- a/app/api/controller/OaApprove.php +++ b/app/api/controller/OaApprove.php @@ -147,7 +147,7 @@ class OaApprove extends ApiController } $flow_list = Db::name('Flow')->where('id',$param['flow_id'])->value('flow_list'); $flow = unserialize($flow_list); - if (!empty($param['check_admin_ids'])) { + if (empty($param['check_admin_ids'])) { foreach($flow as $item) { // 当前部门负责人 if ($item['flow_type'] == 1) { @@ -188,7 +188,7 @@ class OaApprove extends ApiController Db::name('FlowStep')->where(['action_id'=>$param['id'],'type'=>1,'delete_time'=>0])->update(['delete_time'=>time()]); Db::name('FlowRecord')->where(['action_id'=>$param['id'],'type'=>1,'delete_time'=>0])->update(['delete_time'=>time()]); - if (!empty($param['check_admin_ids'])) { + if (empty($param['check_admin_ids'])) { if($flow[0]['flow_type'] == 1){ // 部门负责人 $manager = get_department_manager($this->uid); @@ -255,7 +255,8 @@ class OaApprove extends ApiController $param['department_id'] = $this->did; $param['create_time'] = time(); try { - if (!empty($param['check_admin_ids'])) { + + if (empty($param['check_admin_ids'])) { if($flow[0]['flow_type'] == 1){ // 部门负责人 $manager = get_department_manager($this->uid); @@ -285,9 +286,11 @@ class OaApprove extends ApiController $value['sort'] = $key; $value['create_time'] = time(); } + $res = Db::name('FlowStep')->strict(false)->field(true)->insertAll($flow); } else{ + halt(123); $aid = Db::name('Approve')->strict(false)->field(true)->insertGetId($param); $flow_step = array( 'action_id' => $aid,