11 changed files with 295 additions and 0 deletions
			
			
		- 
					80app/Admin/Controllers/WithdrawalController.php
 - 
					16app/Admin/Repositories/Withdrawal.php
 - 
					16app/Models/Withdrawal.php
 - 
					16app/Models/WithdrawalAlipay.php
 - 
					16app/Models/WithdrawalBank.php
 - 
					38database/migrations/2021_09_11_164413_create_withdrawal_table.php
 - 
					37database/migrations/2021_09_11_165223_create_withdrawal_bank_table.php
 - 
					36database/migrations/2021_09_11_170121_create_withdrawal_alipay_table.php
 - 
					8dcat_admin_ide_helper.php
 - 
					15resources/lang/zh_CN/withdrawal-alipay.php
 - 
					17resources/lang/zh_CN/withdrawal.php
 
@ -0,0 +1,80 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
namespace App\Admin\Controllers; | 
				
			|||
 | 
				
			|||
use App\Admin\Repositories\Withdrawal; | 
				
			|||
use Dcat\Admin\Form; | 
				
			|||
use Dcat\Admin\Grid; | 
				
			|||
use Dcat\Admin\Show; | 
				
			|||
use Dcat\Admin\Http\Controllers\AdminController; | 
				
			|||
 | 
				
			|||
class WithdrawalController extends AdminController | 
				
			|||
{ | 
				
			|||
    /** | 
				
			|||
     * Make a grid builder. | 
				
			|||
     * | 
				
			|||
     * @return Grid | 
				
			|||
     */ | 
				
			|||
    protected function grid() | 
				
			|||
    { | 
				
			|||
        return Grid::make(new Withdrawal(), function (Grid $grid) { | 
				
			|||
            $grid->column('id')->sortable(); | 
				
			|||
            $grid->column('user_id'); | 
				
			|||
            $grid->column('user_type'); | 
				
			|||
            $grid->column('price'); | 
				
			|||
            $grid->column('pay_type'); | 
				
			|||
            $grid->column('pay_id'); | 
				
			|||
            $grid->column('status'); | 
				
			|||
            $grid->column('created_at'); | 
				
			|||
            $grid->column('updated_at')->sortable(); | 
				
			|||
         | 
				
			|||
            $grid->filter(function (Grid\Filter $filter) { | 
				
			|||
                $filter->equal('id'); | 
				
			|||
         | 
				
			|||
            }); | 
				
			|||
        }); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * Make a show builder. | 
				
			|||
     * | 
				
			|||
     * @param mixed $id | 
				
			|||
     * | 
				
			|||
     * @return Show | 
				
			|||
     */ | 
				
			|||
    protected function detail($id) | 
				
			|||
    { | 
				
			|||
        return Show::make($id, new Withdrawal(), function (Show $show) { | 
				
			|||
            $show->field('id'); | 
				
			|||
            $show->field('user_id'); | 
				
			|||
            $show->field('user_type'); | 
				
			|||
            $show->field('price'); | 
				
			|||
            $show->field('pay_type'); | 
				
			|||
            $show->field('pay_id'); | 
				
			|||
            $show->field('status'); | 
				
			|||
            $show->field('created_at'); | 
				
			|||
            $show->field('updated_at'); | 
				
			|||
        }); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * Make a form builder. | 
				
			|||
     * | 
				
			|||
     * @return Form | 
				
			|||
     */ | 
				
			|||
    protected function form() | 
				
			|||
    { | 
				
			|||
        return Form::make(new Withdrawal(), function (Form $form) { | 
				
			|||
            $form->display('id'); | 
				
			|||
            $form->text('user_id'); | 
				
			|||
            $form->text('user_type'); | 
				
			|||
            $form->text('price'); | 
				
			|||
            $form->text('pay_type'); | 
				
			|||
            $form->text('pay_id'); | 
				
			|||
            $form->text('status'); | 
				
			|||
         | 
				
			|||
            $form->display('created_at'); | 
				
			|||
            $form->display('updated_at'); | 
				
			|||
        }); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,16 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
namespace App\Admin\Repositories; | 
				
			|||
 | 
				
			|||
use App\Models\Withdrawal as Model; | 
				
			|||
use Dcat\Admin\Repositories\EloquentRepository; | 
				
			|||
 | 
				
			|||
class Withdrawal extends EloquentRepository | 
				
			|||
{ | 
				
			|||
    /** | 
				
			|||
     * Model. | 
				
			|||
     * | 
				
			|||
     * @var string | 
				
			|||
     */ | 
				
			|||
    protected $eloquentClass = Model::class; | 
				
			|||
} | 
				
			|||
@ -0,0 +1,16 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
namespace App\Models; | 
				
			|||
 | 
				
			|||
use Dcat\Admin\Traits\HasDateTimeFormatter; | 
				
			|||
use Illuminate\Database\Eloquent\SoftDeletes; | 
				
			|||
use Illuminate\Database\Eloquent\Model; | 
				
			|||
 | 
				
			|||
class Withdrawal extends Model | 
				
			|||
{ | 
				
			|||
	use HasDateTimeFormatter; | 
				
			|||
    use SoftDeletes; | 
				
			|||
 | 
				
			|||
    protected $table = 'withdrawal'; | 
				
			|||
     | 
				
			|||
} | 
				
			|||
@ -0,0 +1,16 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
namespace App\Models; | 
				
			|||
 | 
				
			|||
use Dcat\Admin\Traits\HasDateTimeFormatter; | 
				
			|||
 | 
				
			|||
use Illuminate\Database\Eloquent\Model; | 
				
			|||
use Illuminate\Database\Eloquent\SoftDeletes; | 
				
			|||
 | 
				
			|||
class WithdrawalAlipay extends Model | 
				
			|||
{ | 
				
			|||
	use HasDateTimeFormatter; | 
				
			|||
	use SoftDeletes; | 
				
			|||
    protected $table = 'withdrawal_alipay'; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,16 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
namespace App\Models; | 
				
			|||
 | 
				
			|||
use Dcat\Admin\Traits\HasDateTimeFormatter; | 
				
			|||
use Illuminate\Database\Eloquent\SoftDeletes; | 
				
			|||
use Illuminate\Database\Eloquent\Model; | 
				
			|||
 | 
				
			|||
class WithdrawalBank extends Model | 
				
			|||
{ | 
				
			|||
	use HasDateTimeFormatter; | 
				
			|||
    use SoftDeletes; | 
				
			|||
 | 
				
			|||
    protected $table = 'withdrawal_bank'; | 
				
			|||
     | 
				
			|||
} | 
				
			|||
@ -0,0 +1,38 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
use Illuminate\Support\Facades\Schema; | 
				
			|||
use Illuminate\Database\Schema\Blueprint; | 
				
			|||
use Illuminate\Database\Migrations\Migration; | 
				
			|||
 | 
				
			|||
class CreateWithdrawalTable extends Migration | 
				
			|||
{ | 
				
			|||
    /** | 
				
			|||
     * Run the migrations. | 
				
			|||
     * | 
				
			|||
     * @return void | 
				
			|||
     */ | 
				
			|||
    public function up() | 
				
			|||
    { | 
				
			|||
        Schema::create('withdrawal', function (Blueprint $table) { | 
				
			|||
            $table->increments('id'); | 
				
			|||
            $table->integer('user_id')->index()->default(0)->comment('用户id'); | 
				
			|||
            $table->string('user_type')->default('')->comment('用户类型'); | 
				
			|||
            $table->decimal('price')->default(0)->comment('提现金额'); | 
				
			|||
            $table->string('pay_type')->default('')->comment('提现方式'); | 
				
			|||
            $table->integer('pay_id')->index()->default(0)->comment('提现id'); | 
				
			|||
            $table->tinyInteger('status')->default(1)->comment('状态 1·待审核 2 已拒绝 3 已通过 4 已打款'); | 
				
			|||
            $table->timestamps(); | 
				
			|||
            $table->softDeletes(); | 
				
			|||
        }); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * Reverse the migrations. | 
				
			|||
     * | 
				
			|||
     * @return void | 
				
			|||
     */ | 
				
			|||
    public function down() | 
				
			|||
    { | 
				
			|||
        Schema::dropIfExists('withdrawal'); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,37 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
use Illuminate\Support\Facades\Schema; | 
				
			|||
use Illuminate\Database\Schema\Blueprint; | 
				
			|||
use Illuminate\Database\Migrations\Migration; | 
				
			|||
 | 
				
			|||
class CreateWithdrawalBankTable extends Migration | 
				
			|||
{ | 
				
			|||
    /** | 
				
			|||
     * Run the migrations. | 
				
			|||
     * | 
				
			|||
     * @return void | 
				
			|||
     */ | 
				
			|||
    public function up() | 
				
			|||
    { | 
				
			|||
        Schema::create('withdrawal_bank', function (Blueprint $table) { | 
				
			|||
            $table->increments('id'); | 
				
			|||
            $table->integer('withdrawal_id')->index()->comment('提现主表'); | 
				
			|||
            $table->string('name')->default('')->comment('银行名称'); | 
				
			|||
            $table->string('branch')->default('')->comment('支行'); | 
				
			|||
            $table->bigInteger('card_number')->default(0)->comment('卡号'); | 
				
			|||
            $table->string('account_name')->default('')->comment('开户人'); | 
				
			|||
            $table->timestamps(); | 
				
			|||
            $table->softDeletes(); | 
				
			|||
        }); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * Reverse the migrations. | 
				
			|||
     * | 
				
			|||
     * @return void | 
				
			|||
     */ | 
				
			|||
    public function down() | 
				
			|||
    { | 
				
			|||
        Schema::dropIfExists('withdrawal_bank'); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,36 @@ | 
				
			|||
<?php | 
				
			|||
 | 
				
			|||
use Illuminate\Support\Facades\Schema; | 
				
			|||
use Illuminate\Database\Schema\Blueprint; | 
				
			|||
use Illuminate\Database\Migrations\Migration; | 
				
			|||
 | 
				
			|||
class CreateWithdrawalAlipayTable extends Migration | 
				
			|||
{ | 
				
			|||
    /** | 
				
			|||
     * Run the migrations. | 
				
			|||
     * | 
				
			|||
     * @return void | 
				
			|||
     */ | 
				
			|||
    public function up() | 
				
			|||
    { | 
				
			|||
        Schema::create('withdrawal_alipay', function (Blueprint $table) { | 
				
			|||
            $table->increments('id'); | 
				
			|||
            $table->integer('withdrawal_id')->index()->comment('提现主表'); | 
				
			|||
            $table->string('account')->default('')->comment('账户'); | 
				
			|||
            $table->string('name')->default('')->comment('账户名称'); | 
				
			|||
            $table->text('qrcode')->nullable()->comment('收款码'); | 
				
			|||
            $table->timestamps(); | 
				
			|||
            $table->softDeletes(); | 
				
			|||
        }); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * Reverse the migrations. | 
				
			|||
     * | 
				
			|||
     * @return void | 
				
			|||
     */ | 
				
			|||
    public function down() | 
				
			|||
    { | 
				
			|||
        Schema::dropIfExists('withdrawal_alipay'); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,15 @@ | 
				
			|||
<?php  | 
				
			|||
return [ | 
				
			|||
    'labels' => [ | 
				
			|||
        'WithdrawalAlipay' => '提现支付宝', | 
				
			|||
        'withdrawal-alipay' => '提现支付宝', | 
				
			|||
    ], | 
				
			|||
    'fields' => [ | 
				
			|||
        'withdrawal_id' => '提现主表', | 
				
			|||
        'account' => '账户', | 
				
			|||
        'name' => '真实姓名', | 
				
			|||
        'qrcode' => '收款码', | 
				
			|||
    ], | 
				
			|||
    'options' => [ | 
				
			|||
    ], | 
				
			|||
]; | 
				
			|||
@ -0,0 +1,17 @@ | 
				
			|||
<?php  | 
				
			|||
return [ | 
				
			|||
    'labels' => [ | 
				
			|||
        'Withdrawal' => '提现记录表', | 
				
			|||
        'withdrawal' => '提现记录表', | 
				
			|||
    ], | 
				
			|||
    'fields' => [ | 
				
			|||
        'user_id' => '用户id', | 
				
			|||
        'user_type' => '用户类型', | 
				
			|||
        'price' => '提现金额', | 
				
			|||
        'pay_type' => '提现方式', | 
				
			|||
        'pay_id' => '提现id', | 
				
			|||
        'status' => '状态', | 
				
			|||
    ], | 
				
			|||
    'options' => [ | 
				
			|||
    ], | 
				
			|||
]; | 
				
			|||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue