|
|
@@ -10,7 +10,7 @@ use yii\web\Controller;
|
|
|
|
|
|
class ApplyController extends BaseController
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
//申请列表
|
|
|
public function actionList()
|
|
|
{
|
|
|
@@ -18,5 +18,25 @@ class ApplyController extends BaseController
|
|
|
$list = ApplyService::getApplyList($where);
|
|
|
util::success($list);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ //审核
|
|
|
+ public function actionCheck()
|
|
|
+ {
|
|
|
+ $id = Yii::$app->request->post('id');
|
|
|
+ $status = Yii::$app->request->post('status', 0);
|
|
|
+ $remark = Yii::$app->request->post('remark', '');
|
|
|
+ $apply = ApplyService::getById($id);
|
|
|
+ if (empty($apply)) {
|
|
|
+ util::fail('找不到申请记录');
|
|
|
+ }
|
|
|
+ if ($apply['status'] != 0) {
|
|
|
+ util::fail('已经审过了');
|
|
|
+ }
|
|
|
+ ApplyService::updateById($id, ['status' => $status, 'remark' => $remark]);
|
|
|
+ if ($status == 1) {
|
|
|
+ ApplyService::pass($id);
|
|
|
+ }
|
|
|
+ util::success('操作成功');
|
|
|
+ }
|
|
|
+
|
|
|
}
|