From eeb18218598873e8f1514e6e956b7eea52291d73 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 26 Nov 2020 17:16:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/SpendController.class.php | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/SpendController.class.php b/Application/Admin/Controller/SpendController.class.php index 35b2470b4..077ecf406 100644 --- a/Application/Admin/Controller/SpendController.class.php +++ b/Application/Admin/Controller/SpendController.class.php @@ -195,7 +195,46 @@ class SpendController extends ThinkController } return $resarr; } - + + public function addStatement() + { + if(!isset($_REQUEST['ids']) || !isset($_REQUEST['type'])) $this->error("参数错误"); + $ids = $_REQUEST['ids']; + + $dbres = D(self::model_name)->where("id in ({$ids}) and type = '1'")->select(); + if(empty($dbres)){ + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"加入结算成功" + )); + } + $ids = array_column($dbres,"id"); + + foreach ($dbres as $key=>$value) { + if($value['withdraw_type'] !=3) { + $this->DBModel->where("id = {$value['id']} and verify_status = 0")->delete(); + } else { + $this->DBModel->where("id = {$value['id']} and verify_status != 2")->delete(); + } + + } + addOperationLog(['op_type'=>2,'key'=>$ids,"op_name"=>"删除结算单",'url'=>U('lists')]); + $this->ajaxReturn(array( + 'status' => 1, + "info"=>"删除成功" + )); + } + protected function editOrderIscheck($ids,$oldval,$newval){ + $dbres = D(self::model_name)->where("id in ({$ids}) and type = '{$oldval}'")->select(); + if(empty($dbres)) return false; + $changeIds = array_column($dbres,"id"); + //执行操作 + $res = D(self::model_name)->where("id in ({$changeIds}) and type = '{$oldval}'")->save(['is_check'=>$newval]); + if(empty($res)) return false; + + return array_column($dbres,"id"); + + } /** * 充值补单功能 */