Пример #1
0
 public function actionList()
 {
     if (isset($_GET['ajax'])) {
         $page = isset($_POST['page']) ? $_POST['page'] : 1;
         $rows = isset($_POST['rows']) ? $_POST['rows'] : 10;
         $apply_obj = new \app\models\Api_apply();
         $data = $apply_obj->get_list([], $page, $rows);
         if (!$data) {
             echo '查询失败';
             exit;
         }
         echo json_encode($data);
     } else {
         return $this->render('list');
     }
 }
Пример #2
0
 public function actionItem()
 {
     $id = isset($_GET['id']) ? $_GET['id'] : '';
     $page = isset($_POST['page']) ? $_POST['page'] : 1;
     $rows = isset($_POST['rows']) ? $_POST['rows'] : 10;
     if (empty($id)) {
         echo '参数有误';
         exit;
     }
     $params = ['aid' => $id, 'is_agree' => 1];
     $apply_obj = new \app\models\Api_apply();
     $apply_info = $apply_obj->get_list($params, $page, $rows);
     $apply_info_rows = $this->process_allly_info($apply_info['rows']);
     \app\models\common\multi::get_multi($apply_info_rows);
     // 根据接口id查询申请记录
     $re['total'] = $apply_info['total'];
     $re['rows'] = $apply_info_rows;
     echo json_encode($re);
 }