sys 3 år sedan
förälder
incheckning
51652fff8a
47 ändrade filer med 2351 tillägg och 0 borttagningar
  1. 2 0
      app/Console/Commands/TestCommand.php
  2. 82 0
      app/Http/Controllers/GrantDistribution/GrantDistributionsController.php
  3. 82 0
      app/Http/Controllers/GrantItem/GrantItemsController.php
  4. 82 0
      app/Http/Controllers/GrantPond/GrantPondsController.php
  5. 30 0
      app/Http/Requests/GrantDistributionCreateRequest.php
  6. 30 0
      app/Http/Requests/GrantDistributionUpdateRequest.php
  7. 30 0
      app/Http/Requests/GrantItemCreateRequest.php
  8. 30 0
      app/Http/Requests/GrantItemUpdateRequest.php
  9. 30 0
      app/Http/Requests/GrantPondCreateRequest.php
  10. 30 0
      app/Http/Requests/GrantPondUpdateRequest.php
  11. 2 0
      app/Models/ContractLog.php
  12. 43 0
      app/Models/GrantDistribution.php
  13. 41 0
      app/Models/GrantItem.php
  14. 49 0
      app/Models/GrantPond.php
  15. 24 0
      app/Presenters/GrantDistributionPresenter.php
  16. 24 0
      app/Presenters/GrantItemPresenter.php
  17. 24 0
      app/Presenters/GrantPondPresenter.php
  18. 3 0
      app/Providers/RepositoryServiceProvider.php
  19. 57 0
      app/Repositories/Eloquent/GrantDistributionRepositoryEloquent.php
  20. 57 0
      app/Repositories/Eloquent/GrantItemRepositoryEloquent.php
  21. 57 0
      app/Repositories/Eloquent/GrantPondRepositoryEloquent.php
  22. 15 0
      app/Repositories/GrantDistributionRepository.php
  23. 15 0
      app/Repositories/GrantItemRepository.php
  24. 15 0
      app/Repositories/GrantPondRepository.php
  25. 46 0
      app/Servers/ContractServer.php
  26. 123 0
      app/Servers/GrantPondServer.php
  27. 33 0
      app/Transformers/GrantDistributionTransformer.php
  28. 33 0
      app/Transformers/GrantItemTransformer.php
  29. 33 0
      app/Transformers/GrantPondTransformer.php
  30. 24 0
      app/Validators/GrantDistributionValidator.php
  31. 24 0
      app/Validators/GrantItemValidator.php
  32. 24 0
      app/Validators/GrantPondValidator.php
  33. 40 0
      database/migrations/2022_10_24_160342_create_grant_ponds_table.php
  34. 36 0
      database/migrations/2022_10_24_160405_create_grant_items_table.php
  35. 37 0
      database/migrations/2022_10_24_160425_create_grant_distributions_table.php
  36. 85 0
      resources/views/admins/grantDistributions/create.blade.php
  37. 86 0
      resources/views/admins/grantDistributions/edit.blade.php
  38. 156 0
      resources/views/admins/grantDistributions/index.blade.php
  39. 85 0
      resources/views/admins/grantItems/create.blade.php
  40. 86 0
      resources/views/admins/grantItems/edit.blade.php
  41. 156 0
      resources/views/admins/grantItems/index.blade.php
  42. 85 0
      resources/views/admins/grantPonds/create.blade.php
  43. 86 0
      resources/views/admins/grantPonds/edit.blade.php
  44. 156 0
      resources/views/admins/grantPonds/index.blade.php
  45. 21 0
      routes/web/grantDistribution.php
  46. 21 0
      routes/web/grantItem.php
  47. 21 0
      routes/web/grantPond.php

+ 2 - 0
app/Console/Commands/TestCommand.php

@@ -36,6 +36,7 @@ use App\Servers\Coupon\CouponGrantServer;
 use App\Servers\Electricity\JdElectricityServer;
 use App\Servers\Electricity\TbElectricityServer;
 use App\Servers\ExpressServer;
+use App\Servers\GrantPondServer;
 use App\Servers\HxServer;
 use App\Servers\Icon\TronRPC;
 use App\Servers\ImgServer;
@@ -96,6 +97,7 @@ class TestCommand extends Command
      */
     public function handle()
     {
+        dd(date('Y-m-d 00:00:00',strtotime(date('Y-m-1 00:00:00',strtotime('+1 month')))-1));
         dd(urldecode('https%3A%2F%2Fwealfavor-1257406827.cos.ap-beijing.myqcloud.com%2Fapp-serve%2F2022-10-24%2Fgeraov3msn.jpg'));
 //        for ($i=1;$i<=20;++$i){
 //            MemberServer::creatServer()->register($i.'abc', 1, '', '');

+ 82 - 0
app/Http/Controllers/GrantDistribution/GrantDistributionsController.php

@@ -0,0 +1,82 @@
+<?php
+
+namespace App\Http\Controllers\GrantDistribution;
+
+use App\Http\Controllers\AdminBaseController;
+use App\Http\Requests\GrantDistributionCreateRequest;
+use App\Http\Requests\GrantDistributionUpdateRequest;
+use App\Repositories\Eloquent\GrantDistributionRepositoryEloquent;
+use App\Validators\GrantDistributionValidator;
+
+/**
+ * Class GrantDistributionsController.
+ *
+ * @package namespace App\Http\Controllers;
+ */
+class GrantDistributionsController extends AdminBaseController
+{
+    /**
+     * @var GrantDistributionRepositoryEloquent
+     */
+    protected $repository;
+
+    /**
+     * @var GrantDistributionValidator
+     */
+    protected $validator;
+
+    /**
+     * GrantDistributionsController constructor.
+     *
+     * @param GrantDistributionRepositoryEloquent $repository
+     * @param GrantDistributionValidator $validator
+     */
+    public function __construct(GrantDistributionRepositoryEloquent $repository, GrantDistributionValidator $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;
+    }
+
+}

+ 82 - 0
app/Http/Controllers/GrantItem/GrantItemsController.php

@@ -0,0 +1,82 @@
+<?php
+
+namespace App\Http\Controllers\GrantItem;
+
+use App\Http\Controllers\AdminBaseController;
+use App\Http\Requests\GrantItemCreateRequest;
+use App\Http\Requests\GrantItemUpdateRequest;
+use App\Repositories\Eloquent\GrantItemRepositoryEloquent;
+use App\Validators\GrantItemValidator;
+
+/**
+ * Class GrantItemsController.
+ *
+ * @package namespace App\Http\Controllers;
+ */
+class GrantItemsController extends AdminBaseController
+{
+    /**
+     * @var GrantItemRepositoryEloquent
+     */
+    protected $repository;
+
+    /**
+     * @var GrantItemValidator
+     */
+    protected $validator;
+
+    /**
+     * GrantItemsController constructor.
+     *
+     * @param GrantItemRepositoryEloquent $repository
+     * @param GrantItemValidator $validator
+     */
+    public function __construct(GrantItemRepositoryEloquent $repository, GrantItemValidator $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;
+    }
+
+}

+ 82 - 0
app/Http/Controllers/GrantPond/GrantPondsController.php

@@ -0,0 +1,82 @@
+<?php
+
+namespace App\Http\Controllers\GrantPond;
+
+use App\Http\Controllers\AdminBaseController;
+use App\Http\Requests\GrantPondCreateRequest;
+use App\Http\Requests\GrantPondUpdateRequest;
+use App\Repositories\Eloquent\GrantPondRepositoryEloquent;
+use App\Validators\GrantPondValidator;
+
+/**
+ * Class GrantPondsController.
+ *
+ * @package namespace App\Http\Controllers;
+ */
+class GrantPondsController extends AdminBaseController
+{
+    /**
+     * @var GrantPondRepositoryEloquent
+     */
+    protected $repository;
+
+    /**
+     * @var GrantPondValidator
+     */
+    protected $validator;
+
+    /**
+     * GrantPondsController constructor.
+     *
+     * @param GrantPondRepositoryEloquent $repository
+     * @param GrantPondValidator $validator
+     */
+    public function __construct(GrantPondRepositoryEloquent $repository, GrantPondValidator $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/GrantDistributionCreateRequest.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class GrantDistributionCreateRequest 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/GrantDistributionUpdateRequest.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class GrantDistributionUpdateRequest 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/GrantItemCreateRequest.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class GrantItemCreateRequest 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/GrantItemUpdateRequest.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class GrantItemUpdateRequest 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/GrantPondCreateRequest.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class GrantPondCreateRequest 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/GrantPondUpdateRequest.php

@@ -0,0 +1,30 @@
+<?php
+
+namespace App\Http\Requests;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class GrantPondUpdateRequest 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 [
+            //
+        ];
+    }
+}

+ 2 - 0
app/Models/ContractLog.php

@@ -28,6 +28,8 @@ use Prettus\Repository\Traits\TransformableTrait;
  * @method static \Illuminate\Database\Eloquent\Builder|ContractLog whereMsg($value)
  * @method static \Illuminate\Database\Eloquent\Builder|ContractLog whereUpdatedAt($value)
  * @mixin \Eloquent
+ * @property string $contract_data 合约数据信息
+ * @method static \Illuminate\Database\Eloquent\Builder|ContractLog whereContractData($value)
  */
 class ContractLog extends Model implements Transformable
 {

+ 43 - 0
app/Models/GrantDistribution.php

@@ -0,0 +1,43 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+use Prettus\Repository\Contracts\Transformable;
+use Prettus\Repository\Traits\TransformableTrait;
+
+/**
+ * Class GrantDistribution.
+ *
+ * @package namespace App\Models;
+ * @property int $id
+ * @property int $m_id 会员ID
+ * @property int $pond_id 分发批次ID
+ * @property float $average_money 平均LK数量
+ * @property int $broadcast_id 广播ID
+ * @property \Illuminate\Support\Carbon|null $created_at
+ * @property \Illuminate\Support\Carbon|null $updated_at
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution newModelQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution newQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution query()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution whereAverageMoney($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution whereBroadcastId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution whereCreatedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution whereId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution whereMId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution wherePondId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantDistribution whereUpdatedAt($value)
+ * @mixin \Eloquent
+ */
+class GrantDistribution extends Model implements Transformable
+{
+    use TransformableTrait;
+
+    /**
+     * The attributes that are mass assignable.
+     *
+     * @var array
+     */
+    protected $guarded = ['id', 'updated_at', 'created_at'];
+
+}

+ 41 - 0
app/Models/GrantItem.php

@@ -0,0 +1,41 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+use Prettus\Repository\Contracts\Transformable;
+use Prettus\Repository\Traits\TransformableTrait;
+
+/**
+ * Class GrantItem.
+ *
+ * @package namespace App\Models;
+ * @property int $id
+ * @property int $m_id 会员ID
+ * @property int $contract_id 合约ID
+ * @property float $add_money 分配数量
+ * @property \Illuminate\Support\Carbon|null $created_at
+ * @property \Illuminate\Support\Carbon|null $updated_at
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem newModelQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem newQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem query()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem whereAddMoney($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem whereContractId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem whereCreatedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem whereId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem whereMId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantItem whereUpdatedAt($value)
+ * @mixin \Eloquent
+ */
+class GrantItem extends Model implements Transformable
+{
+    use TransformableTrait;
+
+    /**
+     * The attributes that are mass assignable.
+     *
+     * @var array
+     */
+    protected $guarded = ['id', 'updated_at', 'created_at'];
+
+}

+ 49 - 0
app/Models/GrantPond.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+use Prettus\Repository\Contracts\Transformable;
+use Prettus\Repository\Traits\TransformableTrait;
+
+/**
+ * Class GrantPond.
+ *
+ * @package namespace App\Models;
+ * @property int $id
+ * @property float $grand_total 累计LK数量
+ * @property float $average_money 平均数量
+ * @property int $status 1:累计中,2:待分发,3:已完成
+ * @property int $total_num 平均总人数
+ * @property string $pond_sn 分发编号
+ * @property string $distribute_date 分发时间
+ * @property string $end_date 累计结束时间
+ * @property \Illuminate\Support\Carbon|null $created_at
+ * @property \Illuminate\Support\Carbon|null $updated_at
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond newModelQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond newQuery()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond query()
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereAverageMoney($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereCreatedAt($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereDistributeDate($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereEndDate($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereGrandTotal($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereId($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond wherePondSn($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereStatus($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereTotalNum($value)
+ * @method static \Illuminate\Database\Eloquent\Builder|GrantPond whereUpdatedAt($value)
+ * @mixin \Eloquent
+ */
+class GrantPond 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/GrantDistributionPresenter.php

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

+ 24 - 0
app/Presenters/GrantItemPresenter.php

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

+ 24 - 0
app/Presenters/GrantPondPresenter.php

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

+ 3 - 0
app/Providers/RepositoryServiceProvider.php

@@ -53,6 +53,9 @@ class RepositoryServiceProvider extends ServiceProvider
         $this->app->bind(\App\Repositories\MemberGradeRepository::class, \App\Repositories\Eloquent\MemberGradeRepositoryEloquent::class);
         $this->app->bind(\App\Repositories\ContractDistributionRepository::class, \App\Repositories\Eloquent\ContractDistributionRepositoryEloquent::class);
         $this->app->bind(\App\Repositories\ContractLogRepository::class, \App\Repositories\Eloquent\ContractLogRepositoryEloquent::class);
+        $this->app->bind(\App\Repositories\GrantPondRepository::class, \App\Repositories\Eloquent\GrantPondRepositoryEloquent::class);
+        $this->app->bind(\App\Repositories\GrantItemRepository::class, \App\Repositories\Eloquent\GrantItemRepositoryEloquent::class);
+        $this->app->bind(\App\Repositories\GrantDistributionRepository::class, \App\Repositories\Eloquent\GrantDistributionRepositoryEloquent::class);
         //:end-bindings:
     }
 }

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

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

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

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

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

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

+ 15 - 0
app/Repositories/GrantDistributionRepository.php

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

+ 15 - 0
app/Repositories/GrantItemRepository.php

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

+ 15 - 0
app/Repositories/GrantPondRepository.php

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

+ 46 - 0
app/Servers/ContractServer.php

@@ -10,6 +10,7 @@ use App\Jobs\BusinessFileJob;
 use App\Jobs\MsgFileJob;
 use App\Models\BlockItems;
 use App\Models\Contract;
+use App\Models\ContractDistribution;
 use App\Models\ContractLog;
 use App\Models\ErrorRecord;
 use App\Models\Invest;
@@ -24,6 +25,10 @@ class ContractServer
 
 
     static private $server = '';
+    private $distributionArr=[
+      1=>'直推奖金',
+      2=>'累计均富池',
+    ];
 
 
     private function __construct()
@@ -97,7 +102,22 @@ class ContractServer
     function oneSettle(Contract $contract){
         if($contract->{'direct_proportion'}>0){
             //直推金额分化
+            $directId=Member::where('id',$contract->{'m_id'})->value('recom_id');
+            if($directId){
+                $this->addDistribution($contract,$directId,1,$contract->{'direct_proportion'},0);
+            }else{
+                $this->addContractLog($contract,'直推人信息异常,跳出首单直推奖');
+            }
+        }
+        if($contract->{'grant_proportion'}>0){
+            //均富池清分
+            $distribution= $this->addDistribution($contract,0,2,$contract->{'grant_proportion'},1);
+            if($distribution){
+                GrantPondServer::creatServer()->grandPond($distribution);
+            }
         }
+
+
     }
 
 
@@ -106,6 +126,32 @@ class ContractServer
      * @param Contract $contract
      */
     function twoSettle(Contract $contract){
+
+    }
+
+    /**
+     * 添加清分信息
+     * @param Contract $contract
+     * @param $toMid
+     * @param $type
+     * @param $money
+     * @param int $isTransition
+     * @return ContractDistribution|\Illuminate\Database\Eloquent\Model
+     */
+    function addDistribution(Contract $contract,$toMid,$type,$money,$isTransition=1){
+        $lkMoney=CommonServer::creatServer()->getConfigValue('lk_money');
+        $lkNum=$lkMoney*$money;
+        return ContractDistribution::create([
+            'contract_id'=>$contract->{'id'},
+            'm_id'=>$contract->{'m_id'},
+            'broadcast_id'=>0,
+            'is_transition'=>$isTransition,
+            'usdt_num'=>$money,
+            'lk_num'=>$lkNum,
+            'lk_money'=>$lkMoney,
+            'type'=>$type,
+            'to_m_id'=>$toMid,
+        ]);
     }
 
     /**

+ 123 - 0
app/Servers/GrantPondServer.php

@@ -0,0 +1,123 @@
+<?php
+
+
+namespace App\Servers;
+
+
+use App\Models\ContractDistribution;
+use App\Models\GrantItem;
+use App\Models\GrantPond;
+use Carbon\Carbon;
+
+/**
+ * 图片OSS管理
+ */
+class GrantPondServer
+{
+
+
+    static private $server = '';
+
+
+    private function __construct()
+    {
+
+    }
+
+    /**
+     * 创建对象
+     * @return GrantPondServer
+     */
+    static function creatServer()
+    {
+        if (empty(self::$server)) {
+            self::$server = new  GrantPondServer();
+        }
+        return self::$server;
+    }
+
+    /**
+     * 积累均富池
+     * @param ContractDistribution $distribution
+     */
+    function grandPond(ContractDistribution $distribution)
+    {
+        $pondData = $this->getPond();
+        GrantPond::where('id',$pondData->{'id'})->increment('grand_total',$distribution->{'lk_num'});
+        GrantItem::create([
+            'm_id' => $distribution->{'m_id'},
+            'contract_id' => $distribution->{'id'},
+            'add_money' => $distribution->{'lk_num'},
+        ]);
+    }
+
+    function getPond()
+    {
+        $pondData = GrantPond::where('status', 1)->first();
+        if (empty($pondData)) {
+            $pondData=$this->creationPond();
+        } else {
+            //验证累计时间
+            $endDate= Carbon::parse($pondData->{'end_date'}, config('app.timezone'))->format('Y-m-d H:i:s');
+            if($endDate<date('Y-m-d H:i:s')){
+                //更新原有状态,获取新积累
+                $pondData->update(['status' => 2]);
+                $pondData=$this->creationPond();
+            }
+        }
+       return $pondData;
+    }
+
+
+    private function creationPond(){
+        return GrantPond::create([
+           'grand_total'=>0,
+            'average_money' => 0,
+            'total_num' => 0,
+            'status' => 1,
+            'end_date' => $this->getEndDate(),
+            'distribute_date' => $this->getDistributeDate(),
+            'pond_sn' => IndentNumServer::creatServer()->getIndentNum(2)
+        ]);
+    }
+
+
+    /**
+     * 获取发放时间
+     * @return false|string
+     */
+    function getDistributeDate(){
+        $date = date('d');
+        if ($date <= 5) {
+            $distributeDate = date('Y-m-10 00:00:00');
+        } elseif ($date <= 15) {
+            $distributeDate = date('Y-m-20 00:00:00');
+        }  elseif ($date <= 25) {
+            $distributeDate = date('Y-m-d 00:00:00',strtotime(date('Y-m-1 00:00:00',strtotime('+1 month')))-1);
+        }else {
+            $distributeDate = date('Y-m-10 00:00:00',strtotime('+1 month'));
+        }
+        return $distributeDate;
+    }
+
+    /**
+     * 获取积累时间
+     * @return false|string
+     */
+    function getEndDate()
+    {
+        $date = date('d');
+        if ($date <= 5) {
+            $endDate = date('Y-m-5 00:00:00');
+        } elseif ($date <= 15) {
+            $endDate = date('Y-m-15 00:00:00');
+        }  elseif ($date <= 25) {
+            $endDate = date('Y-m-25 00:00:00');
+        }else {
+            $endDate = date('Y-m-5 00:00:00',strtotime('+1 month'));
+        }
+        return $endDate;
+    }
+
+
+}

+ 33 - 0
app/Transformers/GrantDistributionTransformer.php

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

+ 33 - 0
app/Transformers/GrantItemTransformer.php

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

+ 33 - 0
app/Transformers/GrantPondTransformer.php

@@ -0,0 +1,33 @@
+<?php
+
+namespace App\Transformers;
+
+use League\Fractal\TransformerAbstract;
+use App\Models\GrantPond;
+
+/**
+ * Class GrantPondTransformer.
+ *
+ * @package namespace App\Transformers;
+ */
+class GrantPondTransformer extends TransformerAbstract
+{
+    /**
+     * Transform the GrantPond entity.
+     *
+     * @param \App\Models\GrantPond $model
+     *
+     * @return array
+     */
+    public function transform(GrantPond $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/GrantDistributionValidator.php

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

+ 24 - 0
app/Validators/GrantItemValidator.php

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

+ 24 - 0
app/Validators/GrantPondValidator.php

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

+ 40 - 0
database/migrations/2022_10_24_160342_create_grant_ponds_table.php

@@ -0,0 +1,40 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+/**
+ * Class CreateGrantPondsTable.
+ */
+class CreateGrantPondsTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('grant_ponds', function(Blueprint $table) {
+            $table->increments('id');
+            $table->double('grand_total',16,6)->default(0)->comment('累计LK数量');
+            $table->double('average_money',16,6)->default(0)->comment('平均数量');
+            $table->integer('status')->default(1)->comment('1:累计中,2:待分发,3:已完成');
+            $table->integer('total_num')->default(1)->comment('平均总人数');
+            $table->string('pond_sn')->default('')->comment('分发编号');
+            $table->timestamp('distribute_date')->comment('分发时间');
+            $table->timestamp('end_date')->comment('累计结束时间');
+            $table->timestamps();
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('grant_ponds');
+	}
+}

+ 36 - 0
database/migrations/2022_10_24_160405_create_grant_items_table.php

@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+/**
+ * Class CreateGrantItemsTable.
+ */
+class CreateGrantItemsTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('grant_items', function(Blueprint $table) {
+            $table->increments('id');
+            $table->integer('m_id')->index('m_id')->comment('会员ID');
+            $table->integer('contract_id')->index('contract_id')->comment('合约ID');
+            $table->double('add_money',16,6)->default(0)->comment('分配数量');
+            $table->timestamps();
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('grant_items');
+	}
+}

+ 37 - 0
database/migrations/2022_10_24_160425_create_grant_distributions_table.php

@@ -0,0 +1,37 @@
+<?php
+
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+/**
+ * Class CreateGrantDistributionsTable.
+ */
+class CreateGrantDistributionsTable extends Migration
+{
+	/**
+	 * Run the migrations.
+	 *
+	 * @return void
+	 */
+	public function up()
+	{
+		Schema::create('grant_distributions', function(Blueprint $table) {
+            $table->increments('id');
+            $table->integer('m_id')->index('m_id')->comment('会员ID');
+            $table->integer('pond_id')->index('pond_id')->comment('分发批次ID');
+            $table->double('average_money',16,6)->default(0)->comment('平均LK数量');
+            $table->integer('broadcast_id')->comment('广播ID');
+            $table->timestamps();
+		});
+	}
+
+	/**
+	 * Reverse the migrations.
+	 *
+	 * @return void
+	 */
+	public function down()
+	{
+		Schema::drop('grant_distributions');
+	}
+}

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

@@ -0,0 +1,85 @@
+<div style="margin-top: 10px;" id="grantDistributions-app">
+    <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
+        新增 - GrantDistribution
+    </div>
+    <el-form action="{{route('admin.grantDistribution.save')}}" method="post" id="form-create">
+        <!-- image -->
+        <ui-file label="图片(686*128)" size="0.5" name="image" :data="{uploadName:'grantDistributions'}" tips="图片建议(686*128)"></ui-file>
+        <!-- link -->
+{{--        <ui-input-text label="grantDistribution链接" name="link" placeholder="grantDistribution跳转链接" 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: '#grantDistributions-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/grantDistributions/edit.blade.php

@@ -0,0 +1,86 @@
+<div style="margin-top: 10px;" id="grantDistributions-app">
+    <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
+        编辑GrantDistribution
+    </div>
+    <el-form action="{{route('admin.grantDistribution.update',array('id'=>$model->id))}}" method="post" id="form-create">
+        <!-- 图片 -->
+        <ui-file label="图片(686*128)" size="0.5" name="image" :data="{uploadName:'grantDistributions'}" 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: '#grantDistributions-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/grantDistributions/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.grantDistribution.index') }}">后台GrantDistribution首页</a></li>
+        <li class="active">GrantDistribution列表</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.grantDistribution.store') }}" data-title="create">
+                    <button class="btn btn-default" type="button">
+                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&ensp;新增GrantDistribution
+                    </button>
+                </a>
+                <a>
+                    <button id="deleteAll" data-url="{{ route('admin.grantDistribution.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('tableGrantDistribution','ContentTable',{
+                searchForm: 'searchForm',   // 表单搜索id 省略默认 'searchForm'
+                url: "{{ route('admin.grantDistribution.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' : 'grantDistributions'
+//                            'pk' : 'id'   // 主键名称不写默认id主键
+                        }
+                    },
+                    {
+                        field: 'sort',
+                        title: '排序',
+                        align: 'center',
+                        valign: 'middle',
+                        sortable: true,
+                        formatter:inputData,
+                        input_data: {
+//                        'class' : 'cursor',     // 当前样式
+//                        'url'   : 'javascript', // url存在 及请求指定地址修改数据
+                            'table' : 'grantDistributions'   // 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.grantDistribution.edit', ['id'=>'-val-'])}}'
+                            },
+                            {
+                                'name'  : '删除',
+                                'class' : 'btn-danger deleteBtn', // class标签 deleteBtn删除 layer弹出框
+                                'url'   : 'javascript:;',
+                                'confirm_url': '{{ route('admin.grantDistribution.destroy', ['id'=>'-val-','is_del'=>1])}}'   // 选择按钮
+                            }
+                        ]
+                    }
+                ]
+            });
+        });
+    </script>
+@endsection

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

@@ -0,0 +1,85 @@
+<div style="margin-top: 10px;" id="grantItems-app">
+    <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
+        新增 - GrantItem
+    </div>
+    <el-form action="{{route('admin.grantItem.save')}}" method="post" id="form-create">
+        <!-- image -->
+        <ui-file label="图片(686*128)" size="0.5" name="image" :data="{uploadName:'grantItems'}" tips="图片建议(686*128)"></ui-file>
+        <!-- link -->
+{{--        <ui-input-text label="grantItem链接" name="link" placeholder="grantItem跳转链接" 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: '#grantItems-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/grantItems/edit.blade.php

@@ -0,0 +1,86 @@
+<div style="margin-top: 10px;" id="grantItems-app">
+    <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
+        编辑GrantItem
+    </div>
+    <el-form action="{{route('admin.grantItem.update',array('id'=>$model->id))}}" method="post" id="form-create">
+        <!-- 图片 -->
+        <ui-file label="图片(686*128)" size="0.5" name="image" :data="{uploadName:'grantItems'}" 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: '#grantItems-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/grantItems/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.grantItem.index') }}">后台GrantItem首页</a></li>
+        <li class="active">GrantItem列表</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.grantItem.store') }}" data-title="create">
+                    <button class="btn btn-default" type="button">
+                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&ensp;新增GrantItem
+                    </button>
+                </a>
+                <a>
+                    <button id="deleteAll" data-url="{{ route('admin.grantItem.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('tableGrantItem','ContentTable',{
+                searchForm: 'searchForm',   // 表单搜索id 省略默认 'searchForm'
+                url: "{{ route('admin.grantItem.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' : 'grantItems'
+//                            'pk' : 'id'   // 主键名称不写默认id主键
+                        }
+                    },
+                    {
+                        field: 'sort',
+                        title: '排序',
+                        align: 'center',
+                        valign: 'middle',
+                        sortable: true,
+                        formatter:inputData,
+                        input_data: {
+//                        'class' : 'cursor',     // 当前样式
+//                        'url'   : 'javascript', // url存在 及请求指定地址修改数据
+                            'table' : 'grantItems'   // 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.grantItem.edit', ['id'=>'-val-'])}}'
+                            },
+                            {
+                                'name'  : '删除',
+                                'class' : 'btn-danger deleteBtn', // class标签 deleteBtn删除 layer弹出框
+                                'url'   : 'javascript:;',
+                                'confirm_url': '{{ route('admin.grantItem.destroy', ['id'=>'-val-','is_del'=>1])}}'   // 选择按钮
+                            }
+                        ]
+                    }
+                ]
+            });
+        });
+    </script>
+@endsection

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

@@ -0,0 +1,85 @@
+<div style="margin-top: 10px;" id="grantPonds-app">
+    <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
+        新增 - GrantPond
+    </div>
+    <el-form action="{{route('admin.grantPond.save')}}" method="post" id="form-create">
+        <!-- image -->
+        <ui-file label="图片(686*128)" size="0.5" name="image" :data="{uploadName:'grantPonds'}" tips="图片建议(686*128)"></ui-file>
+        <!-- link -->
+{{--        <ui-input-text label="grantPond链接" name="link" placeholder="grantPond跳转链接" 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: '#grantPonds-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/grantPonds/edit.blade.php

@@ -0,0 +1,86 @@
+<div style="margin-top: 10px;" id="grantPonds-app">
+    <div style="text-align: center;margin-top: 5px;margin-bottom: 10px;font-size: 20px;">
+        编辑GrantPond
+    </div>
+    <el-form action="{{route('admin.grantPond.update',array('id'=>$model->id))}}" method="post" id="form-create">
+        <!-- 图片 -->
+        <ui-file label="图片(686*128)" size="0.5" name="image" :data="{uploadName:'grantPonds'}" 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: '#grantPonds-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/grantPonds/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.grantPond.index') }}">后台GrantPond首页</a></li>
+        <li class="active">GrantPond列表</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.grantPond.store') }}" data-title="create">
+                    <button class="btn btn-default" type="button">
+                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>&ensp;新增GrantPond
+                    </button>
+                </a>
+                <a>
+                    <button id="deleteAll" data-url="{{ route('admin.grantPond.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('tableGrantPond','ContentTable',{
+                searchForm: 'searchForm',   // 表单搜索id 省略默认 'searchForm'
+                url: "{{ route('admin.grantPond.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' : 'grantPonds'
+//                            'pk' : 'id'   // 主键名称不写默认id主键
+                        }
+                    },
+                    {
+                        field: 'sort',
+                        title: '排序',
+                        align: 'center',
+                        valign: 'middle',
+                        sortable: true,
+                        formatter:inputData,
+                        input_data: {
+//                        'class' : 'cursor',     // 当前样式
+//                        'url'   : 'javascript', // url存在 及请求指定地址修改数据
+                            'table' : 'grantPonds'   // 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.grantPond.edit', ['id'=>'-val-'])}}'
+                            },
+                            {
+                                'name'  : '删除',
+                                'class' : 'btn-danger deleteBtn', // class标签 deleteBtn删除 layer弹出框
+                                'url'   : 'javascript:;',
+                                'confirm_url': '{{ route('admin.grantPond.destroy', ['id'=>'-val-','is_del'=>1])}}'   // 选择按钮
+                            }
+                        ]
+                    }
+                ]
+            });
+        });
+    </script>
+@endsection

+ 21 - 0
routes/web/grantDistribution.php

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

+ 21 - 0
routes/web/grantItem.php

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

+ 21 - 0
routes/web/grantPond.php

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