| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace saas\controllers;
- use biz\saas\services\ApplyService;
- use common\components\util;
- use Yii;
- use yii\web\Controller;
- class ApplyController extends BaseController
- {
-
- //申请列表
- public function actionList()
- {
- $where = [];
- $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('操作成功');
- }
-
- }
|