Commit 96cf75aa authored by 董先生's avatar 董先生

提现核销

parent 02472bf8
......@@ -376,4 +376,56 @@ class Withdraw extends Backend
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 核销提现
*/
public function verification($id = '', $status = -1)
{
$row = $this->model->get($id);
if (!$row) {
$this->error(__('No Results were found'));
}
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
if (!in_array($row[$this->dataLimitField], $adminIds)) {
$this->error(__('You have no permission'));
}
}
if ($this->request->isPost()) {
$params = $this->request->Post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
$result = false;
Db::startTrans();
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
$row->validateFailException(true)->validate($validate);
}
$params['status'] = $status;
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($result !== false) {
$this->success("核销成功");
} else {
$this->error(__('核销失败'));
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->view->assign("row", $row);
return $this->view->fetch();
}
}
......@@ -13,6 +13,7 @@ return [
'Status -1' => '已拒绝',
'Status 0' => '待审核',
'Status 1' => '已通过',
'Status 2' => '已核销',
'Start_time' => '提现时间',
'End_time' => '审核时间',
'Withdraw_way' => '提现方式',
......
......@@ -74,7 +74,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
hidden:function (row) {
return row.status==0?false:true;
},
},
},{
name: 'verification',
text: __('核销'),
title: __('核销'),
classname: 'btn btn-xs btn-warning btn-ajax',
url:function (row) {
return 'users/Withdraw/audit?id='+row.id+'&status=2';
},
refresh:true,
hidden:function (row) {
return row.status==0?false:true;
},
}
],}
]
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment