master
chenzhi 4 years ago
parent 9da9941c9f
commit eeb1821859

@ -196,6 +196,45 @@ class SpendController extends ThinkController
return $resarr; 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");
}
/** /**
* 充值补单功能 * 充值补单功能
*/ */

Loading…
Cancel
Save