wesley.chen 7 年之前
父節點
當前提交
1339dc577b

+ 138 - 0
app/Http/Controllers/Admin/Order/InfoController.php

xqd
@@ -0,0 +1,138 @@
+<?php
+/**
+ *  付款信息
+ *  @author  system
+ *  @version    1.0
+ *  @date 2018-06-08 09:24:20
+ *
+ */
+namespace App\Http\Controllers\Admin\Order;
+use App\Http\Controllers\Admin\Controller;
+use Illuminate\Http\Request;
+use App\Repositories\Base\Criteria\OrderBy;
+use App\Repositories\Order\Criteria\MultiWhere;
+use App\Repositories\Order\InfoRepository;
+
+class InfoController extends Controller
+{
+    private $repository;
+
+    public function __construct(InfoRepository $repository) {
+        if(!$this->repository) $this->repository = $repository;
+    }
+
+    function index(Request $request) {
+        $search['keyword'] = $request->input('keyword');
+        $query = $this->repository->pushCriteria(new MultiWhere($search));
+
+        if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
+        $query = $query->pushCriteria(new OrderBy($request['sort_field'],$request['sort_field_by']));
+        }else{
+            $query = $query->pushCriteria(new OrderBy('id','DESC'));
+        }
+        $list = $query->paginate();
+        return view('admin.order.info.index',compact('list'));
+    }
+
+
+    function check(Request $request) {
+        $request = $request->all();
+        $search['keyword'] = $request->input('keyword');
+        $orderby = array();
+        if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
+            $orderby[$request['sort_field']] = $request['sort_field_by'];
+        }
+        $list = $this->repository->search($search,$orderby);
+        return view('admin.order.info.check',compact('list'));
+    }
+
+
+    /**
+     * 添加
+     * 
+     */
+    public function create(Request $request)
+    {
+        if($request->method() == 'POST') {
+            return $this->_createSave();
+        }
+        return view('admin.order.info.edit');
+    }
+
+    /**
+     * 保存修改
+     */
+    private function _createSave(){
+        $data = (array) request('data');
+        $id = $this->repository->create($data);
+        if($id) {
+            $url[] = array('url'=>U( 'Order/Info/index'),'title'=>'返回列表');
+            $url[] = array('url'=>U( 'Order/Info/create'),'title'=>'继续添加');
+            $this->showMessage('添加成功',$url);
+        }else{
+            $url[] = array('url'=>U( 'Order/Info/index'),'title'=>'返回列表');
+            return $this->showWarning('添加失败',$url);
+        }
+    }
+    
+    /**
+     * 
+     * 修改
+     * 
+     * 
+     */
+    public function update(Request $request) {
+        if($request->method() == 'POST') {
+            return $this->_updateSave();
+        }
+        $data = $this->repository->find($request->get('id'));
+        return view('admin.order.info.edit',compact('data'));
+    }
+
+    /**
+     * 保存修改
+     */
+    private function _updateSave() {
+        $data = (array) request('data');
+        $ok = $this->repository->update(request('id'),$data);
+        if($ok) {
+            $url[] = array('url'=>U( 'Order/Info/index'),'title'=>'返回列表');
+            return $this->showMessage('操作成功',urldecode(request('_referer')));
+        }else{
+            $url[] = array('url'=>U( 'Order/Info/index'),'title'=>'返回列表');
+            return $this->showWarning('操作失败',$url);
+        }
+    }
+
+    public function view(Request $request) {
+        $data = $this->repository->find(request('id'));
+        return view('admin.order.info.view',compact('data'));
+    }
+
+
+    /**
+     *
+     * 状态改变
+     *
+     */
+    public function status(Request $request) {
+        $ok = $this->repository->updateStatus(request('id'),request('status'));
+        if($ok) {
+            return $this->showMessage('操作成功');
+        }else{
+            return $this->showWarning('操作失败');
+        }
+    }
+    
+    /**
+     * 删除
+     */
+    public function destroy(Request $request) {
+        $bool = $this->repository->destroy($request->get('id'));
+        if($bool) {
+            return  $this->showMessage('操作成功');
+        }else{
+            return  $this->showWarning("操作失败");
+        }
+    }
+}

+ 1 - 1
app/Http/Controllers/Api/V1/Controller.php

xqd
@@ -21,7 +21,7 @@ class Controller extends BaseController
         $this->middleware('auth:api', [
             'except' => [
                 'upload', 'getCode', 'reset', 'login', 'get', 'register', 'alipayNotify', 'wechatpayNotify',
-                'get', 'area', 'get_province', 'get_city', 'get_county', 'test','introduction','indexSetting'
+                'get', 'area', 'get_province', 'get_city', 'get_county', 'test','getIntroduction','getBaseData','getQueried','agreeIntroduction'
 
             ]
         ]);

+ 289 - 4
app/Http/Controllers/Api/V1/HomeController.php

xqd xqd xqd
@@ -3,13 +3,95 @@ namespace App\Http\Controllers\Api\V1;
 
 use App\Models\IntroductionInfoModel;
 use App\Models\MajorInfoModel;
+use App\Models\StudentCountModel;
+use App\Models\UserInfoModel;
+use Carbon\Carbon;
+use Illuminate\Http\Request;
+use App\Services\Base\ErrorCode;
+use Validator, Response;
+use EasyWeChat\Factory;
 
 
 class HomeController extends Controller{
 
+    protected $app;
+
+    public function __construct()
+    {
+        $config = [
+            'app_id' => 'wx3cf0f39249eb0exx',
+            'secret' => 'f1c242f4f28f735d4687abb469072axx',
+
+            // 指定 API 调用返回结果的类型:array(default)/collection/object/raw/自定义类名
+            'response_type' => 'array',
+        ];
+
+        $this->app = Factory::miniProgram($config);
+    }
+
+
+    /**
+     * @api {post} /api/home/login 登陆(login)
+     * @apiDescription 登陆(login)
+     * @apiGroup
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [code](必填)
+     * @apiParam {int}    [nickName]
+     * @apiParam {int}    [avatar]
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "userinfo": {
+     *              "id": "",
+     *              "nickname": "",
+     *              "openid": "",
+     *              "has_agreed": ""           //1:已同意说明,进入主页面;0:为同意协议,进入协议说明页面
+     *          }
+     *
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function login(Request $request){
+        $code = $request->get('code');
+        $session = $this->app->auth->session($code);
+
+        $openid = $session['openid'];
+
+        $userinfo = UserInfoModel::where('openid',$openid)->first(['id','nickname','openid','has_agreed']);
+
+        if($userinfo){
+            return $this->api(compact('userinfo'));
+        }else{
+            $data['openid'] = $openid;
+            $data['nickname'] = $request->get('nickName');
+            $data['avatar'] = $request->get('avatar');
+            $data['has_agreed'] = 0;
+
+            $userinfo = UserInfoModel::create($data);
+
+            return $this->api(compact('userinfo'));
+        }
+
+    }
+
     /**
-     * @api {get} /api/home/introduction获取使用说用及协议
-     * @apiDescription 获取使用说用及协
+     * @api {get} /api/home/getintroduction获取使用说用及协议
+     * @apiDescription 获取使用说用及协
      * @apiPermission none
      * @apiVersion 0.1.0
      * @apiSuccessExample {json} Success-Response:
@@ -36,15 +118,89 @@ class HomeController extends Controller{
      * 可能出现的错误代码:
      *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
      */
-    public function introduction(){
+    public function getIntroduction(){
         $list = IntroductionInfoModel::get(['title','content','type']);
 
         return $this->api(compact('list'));
     }
 
 
+    /**
+     * @api {post} /api/home/agreeintroduction   同意使用说用及协议
+     * @apiDescription 同意使用说用及协议
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [userid]   用户ID(必填)
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "userinfo": [
+     *
+     *          ]
+     *
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function agreeIntroduction(Request $request){
+        $userid = $request->get('userid');
+        $data['has_agreed'] =1;
+        $res = UserInfoModel::where('id',$userid)->update($data);
+        if($res){
+            $userinfo = UserInfoModel::where('id',$userid)->first(['id','nickname','openid','has_agreed']);
+        }
+
+        return $this->api(compact('userinfo'));
+
+    }
 
-    public function indexSetting(){
+
+    /**
+     * @api {get} /api/home/getbasedata   获取可选批次及省份
+     * @apiDescription 获取可选批次及省份
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "batchs": [
+     *
+     *          ],
+     *          "provinces":[
+     *
+     *          ]
+     *
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function getBaseData(){
         $batchs = MajorInfoModel::groupBy('batch')->pluck('batch');
 
         $provinces = [
@@ -53,4 +209,133 @@ class HomeController extends Controller{
 
         return $this->api(compact('batchs','provinces'));
     }
+
+
+    /**
+     * @api {post} /api/home/getqueried   查询免费信息
+     * @apiDescription 查询免费信息
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [userid]   用户ID(必填)
+     * @apiParam {string}    [username]   考生姓名(必填)
+     * @apiParam {string}    [cnumber]   考号(必填)
+     * @apiParam {int}    [grade]   高考成绩(必填)
+     * @apiParam {int}    [batch]   批次(必填)
+     * @apiParam {int}    [province]   省份(必填)
+     * @apiParam {int}    [code]   推荐码(选填)
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "batchs": [
+     *
+     *          ],
+     *          "provinces":[
+     *
+     *          ]
+     *
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function getQueried(Request $request){
+        $validator = Validator::make($request->all(),
+            [
+                'cnumber'         => 'required',
+                'username'         => 'required',
+                'grade'         => 'required|integer',
+            ],
+            [
+                'cnumber.required'      => '考号不能为空!',
+                'username.required'    => '姓名不能为空!',
+                'username.required'    => '姓名不能为空!',
+                'grade.required'    => '成绩不能为空!',
+                'grade.integer'    => '请输入正确格式的成绩!',
+            ]
+        );
+
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        /*更新用户的信息*/
+        $this->updateUserinfo();
+
+        $year = 2015;
+        $grade = $request->get('grade');
+        $batch = $request->get('batch');
+        $province = $request->get('province');
+
+        $maxgrade = StudentCountModel::where('year',$year)->orderBy('grade','desc')->first()->grade;
+        if($grade >$maxgrade){
+            $rank = "前10";
+        }else{
+            $rank = StudentCountModel::where('year',$year)->where('grade',$grade)->first(['total'])->total;
+        }
+
+        if($province == "全部省份"){
+            $college = MajorInfoModel::where('year',$year)->where('batch',$batch)->where('min_grade',"<=",$grade)->groupBy('college')->get();
+        }else{
+            $college = MajorInfoModel::where('year',$year)->where('batch',$batch)->where('province','like','%'.$province.'%')->where('min_grade',"<=",$grade)->groupBy('college')->get();
+        }
+
+        $college_count = count($college);
+
+        /*创建查询记录*/
+        $user = UserInfoModel::find(request('userid'));
+        $this-$this->createQueryInfo($user);
+
+        return $this->api(compact('rank','grade','college_count'));
+    }
+
+
+
+
+    public function getPaidMajors(){
+
+    }
+
+    /***
+     * 更新用户信息
+     */
+    public function updateUserinfo(){
+        $userid = request('userid');
+
+        $data['username'] = request('username');
+        $data['mobile'] = request('mobile');
+        $data['grade'] = request('grade');
+        $data['code'] = request('code');
+
+        $res = UserInfoModel::where('id',$userid)->update($data);
+
+    }
+
+    /***
+     * 创建查询记录
+     * @param $userinfo
+     */
+    public function createQueryInfo($userinfo){
+        $data['is_paid'] = 0;
+        $data['cnumber'] = $userinfo->cnumber;
+        $data['grade'] = $userinfo->grade;
+        $data['code'] = $userinfo->code;
+        $data['mobile'] = $userinfo->mobile;
+    }
+
+
+
+
 }

+ 7 - 0
app/Http/Controllers/Api/V1/WechatController.php

xqd
@@ -0,0 +1,7 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: wesley
+ * Date: 2018/6/8
+ * Time: 13:23
+ */

+ 40 - 0
app/Models/OrderInfoModel.php

xqd
@@ -0,0 +1,40 @@
+<?php
+namespace App\Models;
+use App\Models\BaseModel;
+/**
+ *  @description 付款信息
+ *  @author  system;
+ *  @version    1.0
+ *  @date 2018-06-08 09:24:20
+ *
+ */
+class OrderInfoModel extends BaseModel
+{
+    /**
+     * 数据表名
+     *
+     * @var string
+     *
+     */
+    protected $table = 'order_info';
+    /**
+    主键
+     */
+    protected $primaryKey = 'id';
+
+    //分页
+    protected $perPage = PAGE_NUMS;
+
+    /**
+     * 可以被集体附值的表的字段
+     *
+     * @var string
+     */
+    protected $fillable = [
+                           'order_no',
+                           'price',
+                           'user_id',
+                           'code'
+                          ];
+
+}

+ 45 - 0
app/Repositories/Order/Criteria/MultiWhere.php

xqd
@@ -0,0 +1,45 @@
+<?php
+/**
+ * User: Mike
+ * Email: m@9026.com
+ * Date: 2017/1/12
+ * Time: 17:52
+ */
+
+namespace App\Repositories\Order\Criteria;
+
+
+use App\Repositories\Base\Criteria;
+use App\Repositories\Contracts\RepositoryInterface as Repository;
+
+class MultiWhere extends Criteria
+{
+
+    private $search = [];
+
+    /**
+     * MultiWhere constructor.
+     * @param array $search
+     *
+     */
+    public function __construct(array $search)
+    {
+        $this->search = $search;
+    }
+
+    /**
+     * @param $model
+     * @param RepositoryInterface $repository
+     * @return mixed
+     */
+    public function apply($model, Repository $repository)
+    {
+        if (isset($this->search['keyword']) && $this->search['keyword']) {
+            $model = $model->where('order_no', 'like', $this->search['keyword'])
+                ->orwhere('code', 'like', $this->search['keyword']);
+        }
+
+        return $model;
+    }
+
+}

+ 21 - 0
app/Repositories/Order/InfoRepository.php

xqd
@@ -0,0 +1,21 @@
+<?php
+/**
+ *   付款信息
+ *  @author  system
+ *  @version    1.0
+ *  @date 2018-06-08 09:24:20
+ *
+ */
+namespace App\Repositories\Order;
+
+use App\Repositories\Base\Repository;
+
+
+class InfoRepository extends Repository {
+
+    public function model() {
+        return \App\Models\OrderInfoModel::class;
+    }
+
+    
+}

+ 11 - 11
app/Repositories/Student/Criteria/MultiWhere.php

xqd xqd
@@ -9,12 +9,11 @@
 namespace App\Repositories\Student\Criteria;
 
 
-
-
 use App\Repositories\Base\Criteria;
 use App\Repositories\Contracts\RepositoryInterface as Repository;
 
-class MultiWhere extends Criteria {
+class MultiWhere extends Criteria
+{
 
     private $search = [];
 
@@ -29,17 +28,18 @@ class MultiWhere extends Criteria {
     }
 
     /**
-    * @param $model
-    * @param RepositoryInterface $repository
-    * @return mixed
-    */
+     * @param $model
+     * @param RepositoryInterface $repository
+     * @return mixed
+     */
     public function apply($model, Repository $repository)
     {
-          if(isset($this->search['updated_at']) && $this->search['updated_at']) {
-                                    $model = $model->where('updated_at',$this->search['updated_at']);
-                                 }
+        if (isset($this->search['keyword']) && $this->search['keyword']) {
+            $model = $model->where('year', 'like', $this->search['keyword'])
+                ->orwhere('class', 'like', $this->search['keyword']);
+        }
 
-         return $model;
+        return $model;
     }
 
 }

+ 32 - 0
database/migrations/2018_06_08_054009_add_user_id_to_query_info.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddUserIdToQueryInfo extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('query_info', function (Blueprint $table) {
+            $table->integer('user_id')->after('id')->comment('用户ID');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('query_info', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 37 - 0
database/migrations/2018_06_08_091607_create_ord_info_table.php

xqd
@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class CreateOrdInfoTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('order_info', function (Blueprint $table) {
+            $table->increments('id');
+            $table->string('order_no',64)->comment('订单号');
+            $table->double('price')->comment('支付金额');
+            $table->integer('user_id')->comment('用户ID');
+            $table->integer('code')->comment('推荐码');
+
+            $table->softDeletes();
+            $table->timestamps();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('order_info');
+    }
+}

+ 40 - 1
database/seeds/init.sql

xqd
@@ -47,7 +47,46 @@ VALUES
 	(606, 596, 'Base/Settings/destroy', '删除', 0, 1, 1, '', ' ', '2017-05-31 04:56:09', '2017-05-31 04:56:09', NULL),
 	(607, 596, 'Base/Settings/view', '查看', 0, 1, 1, '', ' ', '2017-05-31 04:56:09', '2017-05-31 04:56:09', NULL),
 	(608, 596, 'Base/Settings/check', '选择数据', 0, 1, 1, '', ' ', '2017-05-31 04:56:09', '2017-05-31 04:56:09', NULL),
-	(609, 1, 'Base/Photos/index', '图片管理', 1, 1, 2, '', '图片管理', '2017-08-02 06:43:20', '2017-08-02 06:43:21', NULL);
+	(609, 1, 'Base/Photos/index', '图片管理', 1, 1, 2, '', '图片管理', '2017-08-02 06:43:20', '2017-08-02 06:43:21', NULL),
+  (610, 0, '#', '分数线管理', 1, 99, 1, '', '分数线管理', '2018-06-07 06:36:54', '2018-06-07 06:36:54', NULL),
+  (611, 0, '#', '付费查询管理', 1, 98, 1, '', '付费查询管理', '2018-06-07 06:37:28', '2018-06-07 06:37:28', NULL),
+  (613, 610, 'Cutoff/Score/index', '分数线', 1, 1, 1, '', '', '2018-06-07 06:39:49', '2018-06-07 06:39:49', NULL),
+  (614, 613, 'Cutoff/Score/create', '添加', 0, 1, 1, '', '', '2018-06-07 06:39:49', '2018-06-07 06:39:49', NULL),
+  (615, 613, 'Cutoff/Score/update', '修改', 0, 1, 1, '', '', '2018-06-07 06:39:49', '2018-06-07 06:39:49', NULL),
+  (616, 613, 'Cutoff/Score/destroy', '删除', 0, 1, 1, '', '', '2018-06-07 06:39:49', '2018-06-07 06:39:49', NULL),
+  (617, 613, 'Cutoff/Score/view', '查看', 0, 1, 1, '', '', '2018-06-07 06:39:49', '2018-06-07 06:39:49', NULL),
+  (618, 613, 'Cutoff/Score/check', '选择数据', 0, 1, 1, '', '', '2018-06-07 06:39:49', '2018-06-07 06:39:49', NULL),
+  (619, 610, 'Major/Info/index', '专业信息', 1, 1, 1, '', '', '2018-06-07 06:44:02', '2018-06-07 06:44:02', NULL),
+  (620, 619, 'Major/Info/create', '添加', 0, 1, 1, '', '', '2018-06-07 06:44:02', '2018-06-07 06:44:02', NULL),
+  (621, 619, 'Major/Info/update', '修改', 0, 1, 1, '', '', '2018-06-07 06:44:02', '2018-06-07 06:44:02', NULL),
+  (622, 619, 'Major/Info/destroy', '删除', 0, 1, 1, '', '', '2018-06-07 06:44:02', '2018-06-07 06:44:02', NULL),
+  (623, 619, 'Major/Info/view', '查看', 0, 1, 1, '', '', '2018-06-07 06:44:02', '2018-06-07 06:44:02', NULL),
+  (624, 619, 'Major/Info/check', '选择数据', 0, 1, 1, '', '', '2018-06-07 06:44:02', '2018-06-07 06:44:02', NULL),
+  (625, 611, 'Query/Info/index', '查询记录', 1, 1, 1, '', '', '2018-06-07 06:44:54', '2018-06-07 06:44:54', NULL),
+  (626, 625, 'Query/Info/create', '添加', 0, 1, 1, '', '', '2018-06-07 06:44:54', '2018-06-07 06:44:54', NULL),
+  (627, 625, 'Query/Info/update', '修改', 0, 1, 1, '', '', '2018-06-07 06:44:54', '2018-06-07 06:44:54', NULL),
+  (628, 625, 'Query/Info/destroy', '删除', 0, 1, 1, '', '', '2018-06-07 06:44:54', '2018-06-07 06:44:54', NULL),
+  (629, 625, 'Query/Info/view', '查看', 0, 1, 1, '', '', '2018-06-07 06:44:54', '2018-06-07 06:44:54', NULL),
+  (630, 625, 'Query/Info/check', '选择数据', 0, 1, 1, '', '', '2018-06-07 06:44:54', '2018-06-07 06:44:54', NULL),
+  (631, 611, 'Paid/Setting/index', '付费设置', 1, 1, 1, '', '', '2018-06-07 06:45:20', '2018-06-07 06:45:20', NULL),
+  (632, 631, 'Paid/Setting/create', '添加', 0, 1, 1, '', '', '2018-06-07 06:45:20', '2018-06-07 06:45:20', NULL),
+  (633, 631, 'Paid/Setting/update', '修改', 0, 1, 1, '', '', '2018-06-07 06:45:20', '2018-06-07 06:45:20', NULL),
+  (634, 631, 'Paid/Setting/destroy', '删除', 0, 1, 1, '', '', '2018-06-07 06:45:20', '2018-06-07 06:45:20', NULL),
+  (635, 631, 'Paid/Setting/view', '查看', 0, 1, 1, '', '', '2018-06-07 06:45:20', '2018-06-07 06:45:20', NULL),
+  (636, 631, 'Paid/Setting/check', '选择数据', 0, 1, 1, '', '', '2018-06-07 06:45:20', '2018-06-07 06:45:20', NULL),
+  (637, 612, 'Student/Count/index', '人数统计', 1, 1, 1, '', '', '2018-06-07 06:45:42', '2018-06-07 06:45:42', NULL),
+  (638, 637, 'Student/Count/create', '添加', 0, 1, 1, '', '', '2018-06-07 06:45:42', '2018-06-07 06:45:42', NULL),
+  (639, 637, 'Student/Count/update', '修改', 0, 1, 1, '', '', '2018-06-07 06:45:42', '2018-06-07 06:45:42', NULL),
+  (640, 637, 'Student/Count/destroy', '删除', 0, 1, 1, '', '', '2018-06-07 06:45:42', '2018-06-07 06:45:42', NULL),
+  (641, 637, 'Student/Count/view', '查看', 0, 1, 1, '', '', '2018-06-07 06:45:42', '2018-06-07 06:45:42', NULL),
+  (642, 637, 'Student/Count/check', '选择数据', 0, 1, 1, '', '', '2018-06-07 06:45:42', '2018-06-07 06:45:42', NULL),
+  (643, 0, '#', '使用说明', 1, 96, 1, '', '使用说明', '2018-06-07 07:34:14', '2018-06-07 07:34:14', NULL),
+  (644, 643, 'Introduction/Info/index', '使用说明', 1, 1, 1, '', '', '2018-06-07 07:34:45', '2018-06-07 07:34:45', NULL),
+  (645, 644, 'Introduction/Info/create', '添加', 0, 1, 1, '', '', '2018-06-07 07:34:45', '2018-06-07 07:34:45', NULL),
+  (646, 644, 'Introduction/Info/update', '修改', 0, 1, 1, '', '', '2018-06-07 07:34:45', '2018-06-07 07:34:45', NULL),
+  (647, 644, 'Introduction/Info/destroy', '删除', 0, 1, 1, '', '', '2018-06-07 07:34:45', '2018-06-07 07:34:45', NULL),
+  (648, 644, 'Introduction/Info/view', '查看', 0, 1, 1, '', '', '2018-06-07 07:34:45', '2018-06-07 07:34:45', NULL),
+  (649, 644, 'Introduction/Info/check', '选择数据', 0, 1, 1, '', '', '2018-06-07 07:34:45', '2018-06-07 07:34:45', NULL);
 
 
 

+ 90 - 0
resources/views/admin/order/info/check.blade.php

xqd
@@ -0,0 +1,90 @@
+@extends('admin.layout')
+
+@section('content')
+		<div class="row">
+			<div class="col-sm-12">
+				<div class="ibox float-e-margins">
+					<div class="ibox-title">
+						<h5>付款信息</h5>
+						<div class="ibox-tools">
+							<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+							</a>
+						</div>
+					</div>
+					<div class="ibox-content">
+						<div class="row">
+							<form method="GET" action="" accept-charset="UTF-8">
+
+								<div class="col-sm-4">
+									<div class="input-group">
+										<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入关键词" name="keyword"class="input-sm form-control">
+								<span class="input-group-btn">
+									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
+								</span>
+									</div>
+								</div>
+							</form>
+							@if(role('Order/Info/create'))
+								<div class="col-sm-3 pull-right">
+									<a href="{{ U('Order/Info/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
+								</div>
+							@endif
+						</div>
+
+						<table class="table table-striped table-bordered table-hover dataTables-example dataTable dataCheckTable">
+							<thead>
+							<tr>
+								<th><input class="btSelectAll" name="btSelectAll" type="checkbox"></th>
+								
+            <th class="sorting" data-sort="id">  </th>
+            <th class="sorting" data-sort="order_no"> 订单号 </th>
+            <th class="sorting" data-sort="price"> 支付金额 </th>
+            <th class="sorting" data-sort="user_id"> 用户ID </th>
+            <th class="sorting" data-sort="code"> 推荐码 </th>
+            <th class="sorting" data-sort="created_at">  </th>
+            <th class="sorting" data-sort="updated_at">  </th>
+								<th width="22%">相关操作</th>
+							</tr>
+							</thead>
+							<tbody>
+							@if(isset($list))
+								@foreach($list as $key => $item)
+									<tr>
+									<td><input data-json='{!! json_encode($item) !!}'  name="btSelectItem" class="data_key" type="checkbox" value="{{ $item->id or 0 }}" /></td>
+									
+            <td>{{ $item->id }}</td>
+            <td>{{ $item->order_no }}</td>
+            <td>{{ $item->price }}</td>
+            <td>{{ $item->user_id }}</td>
+            <td>{{ $item->code }}</td>
+            <td>{{ $item->created_at }}</td>
+            <td>{{ $item->updated_at }}</td>
+									<td>
+										@if(role('Order/Info/view'))
+											<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Order/Info/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
+										@endif
+									</td>
+								</tr>
+								@endforeach
+							@endif
+
+							</tbody>
+						</table>
+						<div class="row">
+							<div class="col-sm-6">
+								<div class="dataTables_info" id="DataTables_Table_0_info"
+									 role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
+							</div>
+							<div class="col-sm-6">
+								<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+									{!! $list->setPath('')->appends(Request::all())->render() !!}
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	@include('admin.tools.check_script');
+
+@endsection

+ 95 - 0
resources/views/admin/order/info/edit.blade.php

xqd
@@ -0,0 +1,95 @@
+@extends('admin.layout')
+
+@section('content')
+
+<?php
+    if(!isset($data)) $data = array();
+    if(!$data && session("data")){
+        $data = session("data");
+    }
+    if(!$data && session('_old_input')){
+        $data = session("_old_input");
+    }
+?>
+	<div class="row">
+		<div class="col-sm-12">
+			<div class="ibox float-e-margins">
+				<div class="ibox-title">
+					<h5>付款信息</h5>
+					<div class="ibox-tools">
+						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+						</a>
+					</div>
+				</div>
+				<div class="ibox-content">
+                    @if(role('Order/Info/index'))
+				    <div class="row">
+    					<div class="col-sm-3 pull-right">
+    					   <a href="{{ U('Order/Info/index')}}" class="btn btn-sm btn-primary pull-right">返回列表</a>
+    					</div>
+					</div>
+                    @endif
+
+		            <div class="row">
+                        <div class="col-lg-10">
+                            <form name="form_product" id="form-validation" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
+
+                                    
+                <div class="form-group">
+                                    
+                 <label class="control-label col-sm-3">订单号</label>
+                                    
+                   <div class="col-sm-9">
+                     <input id="data_order_no" name="data[order_no]" class="form-control" value="{{ $data['order_no'] or ''}}" required="" aria-required="true"  placeholder=""> 
+                    </div>
+                                
+                </div>    
+                <div class="form-group">
+                                    
+                 <label class="control-label col-sm-3">支付金额</label>
+                                    
+                   <div class="col-sm-9">
+                     <input id="data_price" name="data[price]" class="form-control" value="{{ $data['price'] or ''}}" required="" aria-required="true"  placeholder=""> 
+                    </div>
+                                
+                </div>    
+                <div class="form-group">
+                                    
+                 <label class="control-label col-sm-3">用户ID</label>
+                                    
+                   <div class="col-sm-9">
+                     <input id="data_user_id" name="data[user_id]" class="form-control" value="{{ $data['user_id'] or ''}}" required="" aria-required="true"  placeholder=""> 
+                    </div>
+                                
+                </div>    
+                <div class="form-group">
+                                    
+                 <label class="control-label col-sm-3">推荐码</label>
+                                    
+                   <div class="col-sm-9">
+                     <input id="data_code" name="data[code]" class="form-control" value="{{ $data['code'] or ''}}" required="" aria-required="true"  placeholder=""> 
+                    </div>
+                                
+                </div>
+                                
+                                <div class="form-group">
+                                    <label class="control-label col-sm-3">&nbsp;</label>
+                                    <div class="col-sm-9">
+                                        <input type="hidden" name="_referer" value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
+                                        <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
+                                        <input type="submit" class="btn btn-success" style="margin-right:20px;">
+                                        <input type="reset" class="btn btn-default" >
+                                    </div>
+                                </div>
+        
+                            </form>
+                        </div>
+                        <!-- /.col-lg-10 -->
+                    </div>
+                    <!-- /.row -->
+				</div>
+			</div>
+		</div>
+	</div>
+
+@endsection

+ 109 - 0
resources/views/admin/order/info/index.blade.php

xqd
@@ -0,0 +1,109 @@
+@extends('admin.layout')
+
+@section('content')
+    <div class="row">
+        <div class="col-sm-12">
+            <div class="ibox float-e-margins">
+                <div class="ibox-title">
+                    <h5>付款信息</h5>
+                    <div class="ibox-tools">
+                        <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+                        </a>
+                    </div>
+                </div>
+                <div class="ibox-content">
+                    <div class="row">
+                        <form method="GET" action="" accept-charset="UTF-8">
+
+                            <div class="col-sm-4">
+                                <div class="input-group">
+                                    <input type="text" value="{{Request::get('keyword')}}" placeholder="订单号/推荐码"
+                                           name="keyword" class="input-sm form-control">
+                                    <span class="input-group-btn">
+									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
+								</span>
+                                </div>
+                            </div>
+                        </form>
+                        @if(role('Order/Info/create'))
+                            <div class="col-sm-3 pull-right">
+                                <a href="{{ U('Order/Info/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
+                            </div>
+                        @endif
+                    </div>
+
+                    <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                        <thead>
+                        <tr>
+                            <th class="sorting" data-sort="order_no"> 订单号</th>
+                            <th class="sorting" data-sort="price"> 支付金额</th>
+                            <th class="sorting" data-sort="user_id"> 用户ID</th>
+                            <th class="sorting" data-sort="code"> 推荐码</th>
+                            <th class="sorting" data-sort="created_at">创建时间</th>
+                            <th class="sorting" data-sort="updated_at">更新时间</th>
+                            <th width="22%">相关操作</th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        @if(isset($list))
+                            @foreach($list as $key => $item)
+                                <tr>
+                                    <td>{{ $item->order_no }}</td>
+                                    <td>{{ $item->price }}</td>
+                                    <td>{{ $item->user_id }}</td>
+                                    <td>{{ $item->code }}</td>
+                                    <td>{{ $item->created_at }}</td>
+                                    <td>{{ $item->updated_at }}</td>
+                                    <td>
+                                        <div class="btn-group">
+                                            <button data-toggle="dropdown"
+                                                    class="btn btn-warning btn-sm dropdown-toggle"
+                                                    aria-expanded="false">
+                                                操作 <span class="caret"></span>
+                                            </button>
+                                            <ul class="dropdown-menu">
+
+
+                                                @if(role('Order/Info/update'))
+                                                    <li><a href="{{ U('Order/Info/update',['id'=>$item->id])}}"
+                                                           class="font-bold">修改</a></li>
+                                                @endif
+
+                                                @if(role('Order/Info/destroy'))
+                                                    <li class="divider"></li>
+                                                    <li><a href="{{ U('Order/Info/destroy',['id'=>$item->id])}}"
+                                                           onclick="return confirm('你确定执行删除操作?');">删除</a></li>
+                                                @endif
+
+                                            </ul>
+                                        </div>
+                                        @if(role('Order/Info/view'))
+                                            <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Order/Info/view',['id'=>$item->id])}}'});"
+                                                    class="btn btn-primary ">查看
+                                            </button>
+                                        @endif
+                                    </td>
+                                </tr>
+                            @endforeach
+                        @endif
+
+                        </tbody>
+                    </table>
+                    <div class="row">
+                        <div class="col-sm-6">
+                            <div class="dataTables_info" id="DataTables_Table_0_info"
+                                 role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
+                                条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。
+                            </div>
+                        </div>
+                        <div class="col-sm-6">
+                            <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+                                {!! $list->setPath('')->appends(Request::all())->render() !!}
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+@endsection

+ 67 - 0
resources/views/admin/order/info/view.blade.php

xqd
@@ -0,0 +1,67 @@
+@extends('admin.layout')
+
+@section('content')
+<div class="row">
+    <div class="ibox-content">
+        <div class="list-group">
+                                 
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading"></h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['id'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">订单号</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['order_no'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">支付金额</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['price'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">用户ID</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['user_id'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading">推荐码</h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['code'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading"></h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['deleted_at'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading"></h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['created_at'] or ''}}</p>
+                                                 
+               </div>                     
+               <div class="list-group-item">
+                                                  
+                   <h3 class="list-group-item-heading"></h3>
+                                                   
+                   <p class="list-group-item-text"> {{ $data['updated_at'] or ''}}</p>
+                                                 
+               </div>
+        </div>
+    </div>
+</div>
+@endsection

+ 21 - 6
routes/api.php

xqd
@@ -64,14 +64,29 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'uses' => 'AuthController@isLogin',
     ]);
 
-    $api->get('home/introduction', [
-        'as' => 'home.introduction',
-        'uses' => 'HomeController@introduction',
+    $api->get('home/getintroduction', [
+        'as' => 'home.getintroduction',
+        'uses' => 'HomeController@getIntroduction',
     ]);
 
-    $api->get('home/indexsetting', [
-        'as' => 'home.indexsetting',
-        'uses' => 'HomeController@indexSetting',
+    $api->get('home/getbasedata', [
+        'as' => 'home.getbasedata',
+        'uses' => 'HomeController@getBaseData',
+    ]);
+
+    $api->post('home/getqueried', [
+        'as' => 'home.getqueried',
+        'uses' => 'HomeController@getQueried',
+    ]);
+
+    $api->post('home/login', [
+        'as' => 'home.login',
+        'uses' => 'HomeController@login',
+    ]);
+
+    $api->post('home/agreeintroduction', [
+        'as' => 'home.agreeintroduction',
+        'uses' => 'HomeController@agreeIntroduction',
     ]);
 
 });