Ver Fonte

no message

sys há 3 anos atrás
pai
commit
c35675bb0f

+ 3 - 1
.gitignore

@@ -1,6 +1,8 @@
 l_admin.sql
-vendor/
+./vendor/
 .idea/
 .env
 public/.user.ini
 public/.htaccess
+
+vendor/

+ 82 - 0
app/Http/Controllers/MemberGrade/MemberGradesController.php

@@ -0,0 +1,82 @@
+<?php
+
+namespace App\Http\Controllers\MemberGrade;
+
+use App\Http\Controllers\AdminBaseController;
+use App\Http\Requests\MemberGradeCreateRequest;
+use App\Http\Requests\MemberGradeUpdateRequest;
+use App\Repositories\Eloquent\MemberGradeRepositoryEloquent;
+use App\Validators\MemberGradeValidator;
+
+/**
+ * Class MemberGradesController.
+ *
+ * @package namespace App\Http\Controllers;
+ */
+class MemberGradesController extends AdminBaseController
+{
+    /**
+     * @var MemberGradeRepositoryEloquent
+     */
+    protected $repository;
+
+    /**
+     * @var MemberGradeValidator
+     */
+    protected $validator;
+
+    /**
+     * MemberGradesController constructor.
+     *
+     * @param MemberGradeRepositoryEloquent $repository
+     * @param MemberGradeValidator $validator
+     */
+    public function __construct(MemberGradeRepositoryEloquent $repository, MemberGradeValidator $validator)
+    {
+        parent::__construct($repository, $validator);
+    }
+
+    /**
+     * 数据检索
+     */
+     public function _indexScopeQuery()
+        {
+            $where = [];
+            $search = explode(";", request()->input('search', ""));
+            $start = $end = null;
+            $fieldSearchable=$this->repository->getFieldsSearchable();
+            foreach ($search as $value) {
+                if (!empty($value)) {
+                    list($one, $tow) = explode(":", $value);
+                    if (!empty($fieldSearchable[$one])) {
+                        if($fieldSearchable[$one]=='like')$tow="%{$tow}%";
+                        $where[]=[$one,$fieldSearchable[$one],$tow];
+                    } elseif ($one == 'start') {
+                        $start = $tow . " 00:00:00";
+                    } elseif ($one == 'end') {
+                        $end = $tow . " 23:59:59";
+                    } else {
+                        continue;
+                    }
+                }
+            }
+            return function ($query) use ($where, $start, $end) {
+
+                if ($start) $where[] = ['created_at', '>=', $start];
+                if ($end) $where[] = ['created_at', '<=', $end];
+                if ($where) {
+                    $query->where($where);
+                }
+
+            };
+        }
+
+   /**
+     * 数据更新
+     */
+    protected function _indexPost($datum)
+    {
+        return $datum;
+    }
+
+}

+ 30 - 0
app/Http/Requests/MemberGradeCreateRequest.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class MemberGradeCreateRequest extends FormRequest
+{
+    /**
+     * Determine if the user is authorized to make this request.
+     *
+     * @return bool
+     */
+    public function authorize()
+    {
+        return false;
+    }
+
+    /**
+     * Get the validation rules that apply to the request.
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        return [
+            //
+        ];
+    }
+}

+ 30 - 0
app/Http/Requests/MemberGradeUpdateRequest.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class MemberGradeUpdateRequest extends FormRequest
+{
+    /**
+     * Determine if the user is authorized to make this request.
+     *
+     * @return bool
+     */
+    public function authorize()
+    {
+        return false;
+    }
+
+    /**
+     * Get the validation rules that apply to the request.
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        return [
+            //
+        ];
+    }
+}

+ 14 - 0
app/Models/Invest.php

@@ -24,6 +24,20 @@ use Prettus\Repository\Traits\TransformableTrait;
  * @method static \Illuminate\Database\Eloquent\Builder|Invest whereTitle($value)
  * @method static \Illuminate\Database\Eloquent\Builder|Invest whereUpdatedAt($value)
  * @mixin \Eloquent
+ * @property float $direct_proportion 直推比例
+ * @property float $grant_proportion 均富比例
+ * @property float $point_proportion 见点比例
+ * @property float $dao_proportion dao比例
+ * @property float $technology_proportion 技术比例
+ * @property float $reveal_proportion 托底比例
+ * @property float|null $parent_proportion 族谱比例
+ * @method static \Illuminate\Database\Eloquent\Builder|Invest whereDaoProportion($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|Invest whereDirectProportion($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|Invest whereGrantProportion($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|Invest whereParentProportion($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|Invest wherePointProportion($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|Invest whereRevealProportion($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|Invest whereTechnologyProportion($value)
  */
 class Invest extends Model implements Transformable
 {

+ 39 - 0
app/Models/MemberGrade.php

@@ -0,0 +1,39 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+use Prettus\Repository\Contracts\Transformable;
+use Prettus\Repository\Traits\TransformableTrait;
+
+/**
+ * Class MemberGrade.
+ *
+ * @package namespace App\Models;
+ * @property int $id
+ * @property string $grade_name 等级名称
+ * @property float $grade_money 推荐收益比列
+ * @property \Illuminate\Support\Carbon|null $created_at
+ * @property \Illuminate\Support\Carbon|null $updated_at
+ * @method static \Illuminate\Database\Eloquent\Builder|MemberGrade newModelQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|MemberGrade newQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|MemberGrade query()
+ * @method static \Illuminate\Database\Eloquent\Builder|MemberGrade whereCreatedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|MemberGrade whereGradeMoney($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|MemberGrade whereGradeName($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|MemberGrade whereId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|MemberGrade whereUpdatedAt($value)
+ * @mixin \Eloquent
+ */
+class MemberGrade extends Model implements Transformable
+{
+    use TransformableTrait;
+
+    /**
+     * The attributes that are mass assignable.
+     *
+     * @var array
+     */
+    protected $guarded = ['id', 'updated_at', 'created_at'];
+
+}

+ 24 - 0
app/Presenters/MemberGradePresenter.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Presenters;
+
+use App\Transformers\MemberGradeTransformer;
+use Prettus\Repository\Presenter\FractalPresenter;
+
+/**
+ * Class MemberGradePresenter.
+ *
+ * @package namespace App\Presenters;
+ */
+class MemberGradePresenter extends FractalPresenter
+{
+    /**
+     * Transformer
+     *
+     * @return \League\Fractal\TransformerAbstract
+     */
+    public function getTransformer()
+    {
+        return new MemberGradeTransformer();
+    }
+}

+ 1 - 0
app/Providers/RepositoryServiceProvider.php

@@ -50,6 +50,7 @@ class RepositoryServiceProvider extends ServiceProvider
         $this->app->bind(\App\Repositories\ContractRepository::class, \App\Repositories\Eloquent\ContractRepositoryEloquent::class);
         $this->app->bind(\App\Repositories\InvestRepository::class, \App\Repositories\Eloquent\InvestRepositoryEloquent::class);
         $this->app->bind(\App\Repositories\MemberBothRepository::class, \App\Repositories\Eloquent\MemberBothRepositoryEloquent::class);
+        $this->app->bind(\App\Repositories\MemberGradeRepository::class, \App\Repositories\Eloquent\MemberGradeRepositoryEloquent::class);
         //:end-bindings:
     }
 }

+ 57 - 0
app/Repositories/Eloquent/MemberGradeRepositoryEloquent.php

@@ -0,0 +1,57 @@
+<?php
+
+namespace App\Repositories\Eloquent;
+
+use Prettus\Repository\Eloquent\BaseRepository;
+use Prettus\Repository\Criteria\RequestCriteria;
+use App\Repositories\MemberGradeRepository;
+use App\Models\MemberGrade;
+use App\Validators\MemberGradeValidator;
+
+/**
+ * Class MemberGradeRepositoryEloquent.
+ *
+ * @package namespace App\Repositories\Eloquent;
+ */
+class MemberGradeRepositoryEloquent extends BaseRepository implements MemberGradeRepository
+{
+    /**
+     * 查询检索的字段
+     *
+     * @return string
+     */
+    protected $fieldSearchable = [
+        'id'                => '=',
+    ];
+
+    /**
+     * Specify Model class name
+     *
+     * @return string
+     */
+    public function model()
+    {
+        return MemberGrade::class;
+    }
+
+    /**
+    * Specify Validator class name
+    *
+    * @return mixed
+    */
+    public function validator()
+    {
+
+        return MemberGradeValidator::class;
+    }
+
+
+    /**
+     * Boot up the repository, pushing criteria
+     */
+    public function boot()
+    {
+        // $this->pushCriteria(app(RequestCriteria::class));
+    }
+
+}

+ 15 - 0
app/Repositories/MemberGradeRepository.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace App\Repositories;
+
+use Prettus\Repository\Contracts\RepositoryInterface;
+
+/**
+ * Interface MemberGradeRepository.
+ *
+ * @package namespace App\Repositories;
+ */
+interface MemberGradeRepository extends RepositoryInterface
+{
+    //
+}

+ 21 - 3
app/Servers/ContractServer.php

@@ -11,6 +11,7 @@ use App\Jobs\MsgFileJob;
 use App\Models\BlockItems;
 use App\Models\Contract;
 use App\Models\ErrorRecord;
+use App\Models\Member;
 use App\Servers\Icon\TronRPC;
 
 /**
@@ -40,7 +41,10 @@ class ContractServer
         return self::$server;
     }
 
-
+    /**
+     * 报单信息检测
+     * @param BlockItems $blockItem
+     */
     function broadcastDetection(BlockItems $blockItem){
         //检测报单信息
         $contract=Contract::where('hash',$blockItem->{'hash'})->first();
@@ -57,10 +61,14 @@ class ContractServer
                     //检测交易信息
                     if($contract->{'type'}==1){
                         //初始合约
-
+                        //生成双轨关系
+                        $member=Member::where('id',$contract->{'m_id'})->select(['id','recom_id'])->first();
+                        JobServer::creatServer()->creatBothJob($member->{'id'},$member->{'recom_id'});
+                        //报单拆分
+                        $this->oneSettle($contract);
                     }else{
                         //复投合约
-
+                        $this->twoSettle($contract);
                     }
                 } else {
                     ErrorRecord::create([
@@ -75,5 +83,15 @@ class ContractServer
     }
 
 
+    function oneSettle(Contract $contract){
+
+    }
+
+
+    function twoSettle(Contract $contract){
+
+    }
+
+
 
 }

+ 33 - 0
app/Transformers/MemberGradeTransformer.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Transformers;
+
+use League\Fractal\TransformerAbstract;
+use App\Models\MemberGrade;
+
+/**
+ * Class MemberGradeTransformer.
+ *
+ * @package namespace App\Transformers;
+ */
+class MemberGradeTransformer extends TransformerAbstract
+{
+    /**
+     * Transform the MemberGrade entity.
+     *
+     * @param \App\Models\MemberGrade $model
+     *
+     * @return array
+     */
+    public function transform(MemberGrade $model)
+    {
+        return [
+            'id'         => (int) $model->id,
+
+            /* place your other model properties here */
+
+            'created_at' => $model->created_at,
+            'updated_at' => $model->updated_at
+        ];
+    }
+}

+ 24 - 0
app/Validators/MemberGradeValidator.php

@@ -0,0 +1,24 @@
+<?php
+
+namespace App\Validators;
+
+use \Prettus\Validator\Contracts\ValidatorInterface;
+use \Prettus\Validator\LaravelValidator;
+
+/**
+ * Class MemberGradeValidator.
+ *
+ * @package namespace App\Validators;
+ */
+class MemberGradeValidator extends LaravelValidator
+{
+    /**
+     * Validation Rules
+     *
+     * @var array
+     */
+    protected $rules = [
+        ValidatorInterface::RULE_CREATE => [],
+        ValidatorInterface::RULE_UPDATE => [],
+    ];
+}

+ 35 - 0
database/migrations/2022_10_24_101213_create_member_grades_table.php

@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+/**
+ * Class CreateMemberGradesTable.
+ */
+class CreateMemberGradesTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('member_grades', function(Blueprint $table) {
+            $table->increments('id');
+            $table->string('grade_name')->default('')->comment('等级名称');
+            $table->double('grade_money',16,6)->default(0)->comment('推荐收益比列');
+            $table->timestamps();
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('member_grades');
+	}
+}

+ 7 - 0
resources/views/admins/invests/edit.blade.php

@@ -9,6 +9,13 @@
         <ui-input-text label="投资名称" name="title" value="{{$model->title}}" placeholder="投资名称" maxlength="255" tips="请输入投资名称" autofocus="true"></ui-input-text>
         <ui-input-float-number :max="9999999" label="投资金额" name="invest_money" value="{{$model->invest_money}}" placeholder="投资金额" maxlength="255" tips="请输入投资金额" autofocus="true"></ui-input-float-number>
         <!-- 是否显示 -->
+        <ui-input-float-number v-if="{{$model->id}}===1" :max="9999999" label="直推奖励" name="direct_proportion" value="{{$model->direct_proportion}}" placeholder="直推奖励" maxlength="255" tips="请输入直推奖励金额" autofocus="true"></ui-input-float-number>
+        <ui-input-float-number v-if="{{$model->id}}===1" :max="9999999" label="均富池" name="grant_proportion" value="{{$model->grant_proportion}}" placeholder="均富池" maxlength="255" tips="请输入均富池金额" autofocus="true"></ui-input-float-number>
+        <ui-input-float-number v-if="{{$model->id}}===1" :max="9999999" label="见点奖" name="point_proportion" value="{{$model->point_proportion}}" placeholder="见点奖" maxlength="255" tips="请输入见点奖金额" autofocus="true"></ui-input-float-number>
+        <ui-input-float-number :max="9999999" label="DAO池" name="dao_proportion" value="{{$model->dao_proportion}}" placeholder="DAO池" maxlength="255" tips="请输入DAO池金额" autofocus="true"></ui-input-float-number>
+        <ui-input-float-number v-if="{{$model->id}}===1" :max="9999999" label="技术奖金" name="technology_proportion" value="{{$model->technology_proportion}}" placeholder="技术奖金" maxlength="255" tips="请输入技术奖金" autofocus="true"></ui-input-float-number>
+        <ui-input-float-number :max="9999999" label="托底池" name="reveal_proportion" value="{{$model->reveal_proportion}}" placeholder="托底池" maxlength="255" tips="请输入托底池金额" autofocus="true"></ui-input-float-number>
+        <ui-input-float-number v-if="{{$model->id}}===2" :max="9999999" label="推荐奖" name="parent_proportion" value="{{$model->parent_proportion}}" placeholder="推荐奖" maxlength="255" tips="请输入推荐奖金额" autofocus="true"></ui-input-float-number>
 
         <ui-submit></ui-submit>
     </el-form>

+ 42 - 1
resources/views/admins/invests/index.blade.php

@@ -70,7 +70,48 @@
                         align: 'center',
                         valign: 'middle'
                     },
-
+                    {
+                        field: 'direct_proportion',
+                        title: '直推奖',
+                        align: 'center',
+                        valign: 'middle'
+                    },
+                    {
+                        field: 'grant_proportion',
+                        title: '均富池',
+                        align: 'center',
+                        valign: 'middle'
+                    },
+                    {
+                        field: 'point_proportion',
+                        title: '见点奖',
+                        align: 'center',
+                        valign: 'middle'
+                    },
+                    {
+                        field: 'dao_proportion',
+                        title: 'DAO池',
+                        align: 'center',
+                        valign: 'middle'
+                    },
+                    {
+                        field: 'technology_proportion',
+                        title: '技术奖金',
+                        align: 'center',
+                        valign: 'middle'
+                    },
+                    {
+                        field: 'reveal_proportion',
+                        title: '托底池',
+                        align: 'center',
+                        valign: 'middle'
+                    },
+                    {
+                        field: 'parent_proportion',
+                        title: '推荐奖',
+                        align: 'center',
+                        valign: 'middle'
+                    },
                     {
                         field: 'created_at',
                         title: '创建时间',

+ 85 - 0
resources/views/admins/memberGrades/create.blade.php

@@ -0,0 +1,85 @@
+<div style="margin-top: 10px;" id="memberGrades-app">
+    <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
+        新增 - MemberGrade
+    </div>
+    <el-form action="{{route('admin.memberGrade.save')}}" method="post" id="form-create">
+        <!-- image -->
+        <ui-file label="图片(686*128)" size="0.5" name="image" :data="{uploadName:'memberGrades'}" tips="图片建议(686*128)"></ui-file>
+        <!-- link -->
+{{--        <ui-input-text label="memberGrade链接" name="link" placeholder="memberGrade跳转链接" maxlength="255" tips="请输入有效的链接" autofocus="true"></ui-input-text>--}}
+        <!-- show -->
+        <ui-radio label="是否开启" :params="params" tips="控制前台是否显示"></ui-radio>
+        <!-- sort -->
+        <ui-input-number label="排序" checked="checked" value="50" name="sort" min="1" max="100" tips="控制前台显示顺序"></ui-input-number>
+        <ui-submit></ui-submit>
+    </el-form>
+</div>
+
+<script type="application/javascript">
+    $(function () {
+        // 注意:Vue组件一定放在jQuery.validator前面验证
+        new Vue({
+            el: '#memberGrades-app',
+            data :function () {
+                return {
+                    params: {
+                        // 注意:group和attr连个属性都不能省略 就算为空
+                        group: {},
+                        attr: {
+                            name: 'status',   // 当前checkbox框的name属性  【必填】
+                            radioCheck:1,   // 当前选中项 int | string   【必填】
+                            label: 'el-radio-button', // 当前样式 默认 el-radio 样式 【非必填】
+                            radios: [ // 每个checkbox 就是一个json对象     【必填】
+                                {
+                                    value:0,      // 当前选中时值也就是value属性的值      【必填】
+                                    label: '关闭',    // 当前提示文字                 【必填】
+                                    disable: false   // 是否禁止点击 默认:false 不禁止
+                                },
+                                {
+                                    value:1,      // 当前选中时值也就是value属性的值      【必填】
+                                    label: '开启',    // 当前提示文字                 【必填】
+                                    disable: false   // 是否禁止点击 默认:false 不禁止
+                                }
+                            ]
+                        }
+                    }
+                };
+            }
+        });
+        jQuery.validator.setDefaults({
+            debug: false,         // 调试模式true不会提交,false允许提交
+            success: "success",   // 匹配成功的class样式名称
+            errorElement: 'div'   // 兼容el标签时使用(兼容el Vue组件label.error标签问题)
+        });
+        // 前台数据验证 验证需要设置window.form全局变量
+        window.form = $('#form-create').validate({
+            rules: {
+                image: {
+                    required: true,
+                    maxlength: 255,
+                    normalizer: function ( value ) {
+                        return $.trim(value);
+                    }
+                },
+                // link: {
+                //     required: true,
+                //     url:true,
+                //     maxlength: 255,
+                //     normalizer: function ( value ) {
+                //         return $.trim(value);
+                //     }
+                // },
+                show: {
+                    required: true
+                },
+                sort: {
+                    required: true,
+                    normalizer: function ( value ) {
+                        return $.trim(value);
+                    }
+                }
+            }
+        });
+    });
+</script>
+@include('layouts.admin.form_script')

+ 86 - 0
resources/views/admins/memberGrades/edit.blade.php

@@ -0,0 +1,86 @@
+<div style="margin-top: 10px;" id="memberGrades-app">
+    <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
+        编辑MemberGrade
+    </div>
+    <el-form action="{{route('admin.memberGrade.update',array('id'=>$model->id))}}" method="post" id="form-create">
+        <!-- 图片 -->
+        <ui-file label="图片(686*128)" size="0.5" name="image" :data="{uploadName:'memberGrades'}" imageurl="{{$model->image}}" tips="图片大小建议(686*128)"></ui-file>
+        <!-- 链接 -->
+{{--        <ui-input-text label="链接" name="link" value="{{$model->link}}" placeholder="跳转链接" maxlength="255" tips="请输入有效的链接" autofocus="true"></ui-input-text>--}}
+        <!-- 是否显示 -->
+        <ui-radio label="是否开启" :params="params" tips="控制前台是否显示"></ui-radio>
+        <!-- 排序 -->
+        <ui-input-number label="排序" checked="checked" name="sort" value="{{$model->sort}}" min="1" max="100" tips="控制前台显示顺序"></ui-input-number>
+        <ui-submit></ui-submit>
+    </el-form>
+</div>
+
+<script type="application/javascript">
+    $(function () {
+        // 注意:Vue组件一定放在jQuery.validator前面验证
+        new Vue({
+            el: '#memberGrades-app',
+            data :function () {
+                return {
+                    params: {
+                        // 注意:group和attr连个属性都不能省略 就算为空
+                        group: {},
+                        attr: {
+                            name: 'status',   // 当前checkbox框的name属性  【必填】
+                            radioCheck:{{$model->status}},   // 当前选中项 int | string   【必填】
+                            label: 'el-radio-button', // 当前样式 默认 el-radio 样式 【非必填】
+                            radios: [ // 每个checkbox 就是一个json对象     【必填】
+                                {
+                                    value:0,      // 当前选中时值也就是value属性的值      【必填】
+                                    label: '关闭',    // 当前提示文字                 【必填】
+                                    disable: false   // 是否禁止点击 默认:false 不禁止
+                                },
+                                {
+                                    value:1,      // 当前选中时值也就是value属性的值      【必填】
+                                    label: '开启',    // 当前提示文字                 【必填】
+                                    disable: false   // 是否禁止点击 默认:false 不禁止
+                                }
+                            ]
+                        }
+                    }
+                };
+            }
+        });
+        jQuery.validator.setDefaults({
+            debug: false,         // 调试模式true不会提交,false允许提交
+            success: "success",   // 匹配成功的class样式名称
+            errorElement: 'div'   // 兼容el标签时使用(兼容el Vue组件label.error标签问题)
+        });
+        // 前台数据验证 验证需要设置window.form全局变量
+        window.form = $('#form-create').validate({
+            rules: {
+                image: {
+                    required: true,
+                    maxlength: 255,
+                    normalizer: function ( value ) {
+                        return $.trim(value);
+                    }
+                },
+                // link: {
+                //     required: true,
+                //     maxlength: 255,
+                //     normalizer: function ( value ) {
+                //         return $.trim(value);
+                //     }
+                // },
+                show: {
+                    required: true
+                },
+                sort: {
+                    required: true,
+                    normalizer: function ( value ) {
+                        return $.trim(value);
+                    }
+                }
+            }
+        });
+        // 编辑保存变量
+        window.formDatum = $('form').serialize();
+    });
+</script>
+@include('layouts.admin.form_script')

+ 156 - 0
resources/views/admins/memberGrades/index.blade.php

@@ -0,0 +1,156 @@
+@extends('layouts.admin.app')
+@section('plug-css')
+    <link href="{{ asset('js/bootstrap-table/dist/bootstrap-table.css') }}" rel="stylesheet">
+@endsection
+@section('crumbs')
+    <ol class="breadcrumb crumbs">
+        <li><a href="{{ route('admin.index') }}#">后台导航</a></li>
+        <li><a href="{{ route('admin.memberGrade.index') }}">后台MemberGrade首页</a></li>
+        <li class="active">MemberGrade列表</li>
+    </ol>
+@endsection
+
+@section('content')
+    <form id="searchForm" class="form-inline">
+        <div class="">
+            <div class="form-group">
+                <label for="name" class="label-css"> ID:</label>
+                <input class="form-control" type="text" name="id">
+            </div>
+            &ensp;&ensp;
+            <button type="button" class="btn btn-primary">查询</button>
+        </div>
+    </form>
+    <hr class="hr-css">
+    <div>
+        <div id="toolbar">
+            <div class="columns columns-left btn-group pull-left">
+                <a class="createForm" data-url="{{ route('admin.memberGrade.store') }}" data-title="create">
+                    <button class="btn btn-default" type="button">
+                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&ensp;新增MemberGrade
+                    </button>
+                </a>
+                <a>
+                    <button id="deleteAll" data-url="{{ route('admin.memberGrade.destroys',['is_del'=>1]) }}" class="btn btn-default" type="button">
+                        <span class="glyphicon glyphicon-trash" aria-hidden="true"></span>&ensp;删除
+                    </button>
+                </a>
+            </div>
+        </div>
+        <table id="ContentTable"></table>
+    </div>
+@endsection
+
+@section('plug-js')
+    <script src="{{ asset('js/bootstrap-table/dist/bootstrap-table.js') }}"></script>
+    <script src="{{ asset('js/bootstrap-table/dist/locale/bootstrap-table-zh-CN.js') }}"></script>
+    <script src="{{ asset('js/jquery-validation1.16/dist/jquery.validate.min.js') }}"></script>
+    <script src="{{ asset('js/jquery-validation1.16/dist/additional-methods.min.js') }}"></script>
+    <script src="{{ asset('js/jquery-validation1.16/src/localization/messages_zh.js') }}"></script>
+@endsection
+
+@section('scripts')
+    <script>
+        $(function(){
+            BootStrapInit.init('tableMemberGrade','ContentTable',{
+                searchForm: 'searchForm',   // 表单搜索id 省略默认 'searchForm'
+                url: "{{ route('admin.memberGrade.ajax.index') }}",
+                method: 'post',
+                toolbar: '#toolbar',
+                idField: '',        // 指定主键列
+                uniqueId: "id",     // 这里需要指定当前查询表唯一主键字段
+                columns: [
+                    {
+                        checkbox: true,
+                        align: 'center',
+                        valign: 'middle'
+                    },
+                    {
+                        field: 'id',
+                        title: 'ID',
+                        align: 'center',
+                        valign: 'middle',
+                        sortable: true
+                    },
+                    {
+                        field: 'image',
+                        title: 'Image',
+                        align: 'center',
+                        valign: 'middle',
+                        formatter:thumbFormatter
+                    },
+                    // {
+                    //     field: 'link',
+                    //     title: '链接',
+                    //     align: 'center',
+                    //     valign: 'middle'
+                    // },
+                    {
+                        field: 'status',
+                        title: '显示',
+                        align: 'center',
+                        valign: 'middle',
+                        sortable: true,
+                        formatter:yesOrNo,
+                        bool_data:{
+                            'class' : 'cursor',
+//                            'url'   : 'javascript:;',
+                            'table' : 'memberGrades'
+//                            'pk' : 'id'   // 主键名称不写默认id主键
+                        }
+                    },
+                    {
+                        field: 'sort',
+                        title: '排序',
+                        align: 'center',
+                        valign: 'middle',
+                        sortable: true,
+                        formatter:inputData,
+                        input_data: {
+//                        'class' : 'cursor',     // 当前样式
+//                        'url'   : 'javascript', // url存在 及请求指定地址修改数据
+                            'table' : 'memberGrades'   // url为空时采用,
+//                        'pk'    : 'id'          // 默认修改主键名称 不写 默认id为主键
+                        }
+                    },
+                    {
+                        field: 'created_at',
+                        title: '创建时间',
+                        align: 'center',
+                        valign: 'middle',
+                        sortable: true
+                    },
+                    {
+                        field: 'updated_at',
+                        title: '更新时间',
+                        align: 'center',
+                        valign: 'middle',
+                        sortable: true
+                    },
+                    {
+                        pkId: 'id',         // 当前主键id 兼容排序 field='id' 默认值id
+                        title: '操作',
+                        align: 'center',
+                        valign: 'middle',
+                        width: '185px',
+                        formatter:operateFormatter,
+                        btn_group:[
+                            {
+                                'name'  : '编辑',
+                                'class' : 'btn-primary createForm',
+                                'url'   : 'javascript:;',
+                                'confirm_url': '{{ route('admin.memberGrade.edit', ['id'=>'-val-'])}}'
+                            },
+                            {
+                                'name'  : '删除',
+                                'class' : 'btn-danger deleteBtn', // class标签 deleteBtn删除 layer弹出框
+                                'url'   : 'javascript:;',
+                                'confirm_url': '{{ route('admin.memberGrade.destroy', ['id'=>'-val-','is_del'=>1])}}'   // 选择按钮
+                            }
+                        ]
+                    }
+                ]
+            });
+        });
+    </script>
+@endsection

+ 21 - 0
routes/web/memberGrade.php

@@ -0,0 +1,21 @@
+<?php
+
+use Illuminate\Support\Facades\Route;
+
+Route::group(['domain' => env('APP_HOST'), 'prefix' => 'admin/memberGrade'],function(){
+    Route::get('index', 'MemberGradesController@index')->name('admin.memberGrade.index');
+    Route::post('index', 'MemberGradesController@index')->name('admin.memberGrade.ajax.index');
+
+    Route::get('store','MemberGradesController@store')->name('admin.memberGrade.store');
+    Route::post('store','MemberGradesController@store')->name('admin.memberGrade.save');
+
+    Route::post('destroy/{id?}','MemberGradesController@destroy')->name('admin.memberGrade.destroy');
+    Route::post('destroys','MemberGradesController@destroys')->name('admin.memberGrade.destroys');
+
+    Route::get('edit/{id?}','MemberGradesController@edit')->name('admin.memberGrade.edit');
+    Route::post('update/{id?}','MemberGradesController@update')->name('admin.memberGrade.update');
+});
+
+Route::group(['domain' => env('APP_HOST_WEB'), 'prefix' => 'memberGrade'],function (){
+    Route::post('list', 'Front\\MemberGradesController@index');
+});