Browse Source

初始化

develop
lemon 4 years ago
parent
commit
ce3ce67221
  1. 80
      app/Admin/Controllers/WithdrawalController.php
  2. 16
      app/Admin/Repositories/Withdrawal.php
  3. 16
      app/Models/Withdrawal.php
  4. 16
      app/Models/WithdrawalAlipay.php
  5. 16
      app/Models/WithdrawalBank.php
  6. 38
      database/migrations/2021_09_11_164413_create_withdrawal_table.php
  7. 37
      database/migrations/2021_09_11_165223_create_withdrawal_bank_table.php
  8. 36
      database/migrations/2021_09_11_170121_create_withdrawal_alipay_table.php
  9. 8
      dcat_admin_ide_helper.php
  10. 15
      resources/lang/zh_CN/withdrawal-alipay.php
  11. 17
      resources/lang/zh_CN/withdrawal.php

80
app/Admin/Controllers/WithdrawalController.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');
});
}
}

16
app/Admin/Repositories/Withdrawal.php

@ -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;
}

16
app/Models/Withdrawal.php

@ -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';
}

16
app/Models/WithdrawalAlipay.php

@ -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';
}

16
app/Models/WithdrawalBank.php

@ -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';
}

38
database/migrations/2021_09_11_164413_create_withdrawal_table.php

@ -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');
}
}

37
database/migrations/2021_09_11_165223_create_withdrawal_bank_table.php

@ -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');
}
}

36
database/migrations/2021_09_11_170121_create_withdrawal_alipay_table.php

@ -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');
}
}

8
dcat_admin_ide_helper.php

@ -129,6 +129,7 @@ namespace Dcat\Admin {
* @property Grid\Column|Collection token * @property Grid\Column|Collection token
* @property Grid\Column|Collection extends * @property Grid\Column|Collection extends
* @property Grid\Column|Collection verify_mobile * @property Grid\Column|Collection verify_mobile
* @property Grid\Column|Collection user_type
* @property Grid\Column|Collection cut_user_id * @property Grid\Column|Collection cut_user_id
* @property Grid\Column|Collection cut_user_type * @property Grid\Column|Collection cut_user_type
* @property Grid\Column|Collection publish_type * @property Grid\Column|Collection publish_type
@ -149,6 +150,7 @@ namespace Dcat\Admin {
* @property Grid\Column|Collection close_time * @property Grid\Column|Collection close_time
* @property Grid\Column|Collection point_id * @property Grid\Column|Collection point_id
* @property Grid\Column|Collection point_type * @property Grid\Column|Collection point_type
* @property Grid\Column|Collection is_read
* @property Grid\Column|Collection workorder_id * @property Grid\Column|Collection workorder_id
* *
* @method Grid\Column|Collection created_at(string $label = null) * @method Grid\Column|Collection created_at(string $label = null)
@ -269,6 +271,7 @@ namespace Dcat\Admin {
* @method Grid\Column|Collection token(string $label = null) * @method Grid\Column|Collection token(string $label = null)
* @method Grid\Column|Collection extends(string $label = null) * @method Grid\Column|Collection extends(string $label = null)
* @method Grid\Column|Collection verify_mobile(string $label = null) * @method Grid\Column|Collection verify_mobile(string $label = null)
* @method Grid\Column|Collection user_type(string $label = null)
* @method Grid\Column|Collection cut_user_id(string $label = null) * @method Grid\Column|Collection cut_user_id(string $label = null)
* @method Grid\Column|Collection cut_user_type(string $label = null) * @method Grid\Column|Collection cut_user_type(string $label = null)
* @method Grid\Column|Collection publish_type(string $label = null) * @method Grid\Column|Collection publish_type(string $label = null)
@ -289,6 +292,7 @@ namespace Dcat\Admin {
* @method Grid\Column|Collection close_time(string $label = null) * @method Grid\Column|Collection close_time(string $label = null)
* @method Grid\Column|Collection point_id(string $label = null) * @method Grid\Column|Collection point_id(string $label = null)
* @method Grid\Column|Collection point_type(string $label = null) * @method Grid\Column|Collection point_type(string $label = null)
* @method Grid\Column|Collection is_read(string $label = null)
* @method Grid\Column|Collection workorder_id(string $label = null) * @method Grid\Column|Collection workorder_id(string $label = null)
*/ */
class Grid {} class Grid {}
@ -414,6 +418,7 @@ namespace Dcat\Admin {
* @property Show\Field|Collection token * @property Show\Field|Collection token
* @property Show\Field|Collection extends * @property Show\Field|Collection extends
* @property Show\Field|Collection verify_mobile * @property Show\Field|Collection verify_mobile
* @property Show\Field|Collection user_type
* @property Show\Field|Collection cut_user_id * @property Show\Field|Collection cut_user_id
* @property Show\Field|Collection cut_user_type * @property Show\Field|Collection cut_user_type
* @property Show\Field|Collection publish_type * @property Show\Field|Collection publish_type
@ -434,6 +439,7 @@ namespace Dcat\Admin {
* @property Show\Field|Collection close_time * @property Show\Field|Collection close_time
* @property Show\Field|Collection point_id * @property Show\Field|Collection point_id
* @property Show\Field|Collection point_type * @property Show\Field|Collection point_type
* @property Show\Field|Collection is_read
* @property Show\Field|Collection workorder_id * @property Show\Field|Collection workorder_id
* *
* @method Show\Field|Collection created_at(string $label = null) * @method Show\Field|Collection created_at(string $label = null)
@ -554,6 +560,7 @@ namespace Dcat\Admin {
* @method Show\Field|Collection token(string $label = null) * @method Show\Field|Collection token(string $label = null)
* @method Show\Field|Collection extends(string $label = null) * @method Show\Field|Collection extends(string $label = null)
* @method Show\Field|Collection verify_mobile(string $label = null) * @method Show\Field|Collection verify_mobile(string $label = null)
* @method Show\Field|Collection user_type(string $label = null)
* @method Show\Field|Collection cut_user_id(string $label = null) * @method Show\Field|Collection cut_user_id(string $label = null)
* @method Show\Field|Collection cut_user_type(string $label = null) * @method Show\Field|Collection cut_user_type(string $label = null)
* @method Show\Field|Collection publish_type(string $label = null) * @method Show\Field|Collection publish_type(string $label = null)
@ -574,6 +581,7 @@ namespace Dcat\Admin {
* @method Show\Field|Collection close_time(string $label = null) * @method Show\Field|Collection close_time(string $label = null)
* @method Show\Field|Collection point_id(string $label = null) * @method Show\Field|Collection point_id(string $label = null)
* @method Show\Field|Collection point_type(string $label = null) * @method Show\Field|Collection point_type(string $label = null)
* @method Show\Field|Collection is_read(string $label = null)
* @method Show\Field|Collection workorder_id(string $label = null) * @method Show\Field|Collection workorder_id(string $label = null)
*/ */
class Show {} class Show {}

15
resources/lang/zh_CN/withdrawal-alipay.php

@ -0,0 +1,15 @@
<?php
return [
'labels' => [
'WithdrawalAlipay' => '提现支付宝',
'withdrawal-alipay' => '提现支付宝',
],
'fields' => [
'withdrawal_id' => '提现主表',
'account' => '账户',
'name' => '真实姓名',
'qrcode' => '收款码',
],
'options' => [
],
];

17
resources/lang/zh_CN/withdrawal.php

@ -0,0 +1,17 @@
<?php
return [
'labels' => [
'Withdrawal' => '提现记录表',
'withdrawal' => '提现记录表',
],
'fields' => [
'user_id' => '用户id',
'user_type' => '用户类型',
'price' => '提现金额',
'pay_type' => '提现方式',
'pay_id' => '提现id',
'status' => '状态',
],
'options' => [
],
];
Loading…
Cancel
Save