Przeglądaj źródła

feat:代理商、行政区划

醉梦人间三千年 4 miesięcy temu
rodzic
commit
d6685dfd14

+ 1 - 0
.gitignore

@@ -24,4 +24,5 @@ yarn-error.log
 public/admin-assets
 /doc
 /database.sql
+/sys_region.sql
 /字典规则.md

+ 64 - 0
app/Admin/Controllers/AgentInfoController.php

@@ -0,0 +1,64 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Services\AgentInfoService;
+use Slowlyo\OwlAdmin\Controllers\AdminController;
+
+/**
+ * 代理商
+ *
+ * @property AgentInfoService $service
+ */
+class AgentInfoController extends AdminController
+{
+	protected string $serviceName = AgentInfoService::class;
+
+	public function list()
+	{
+		$crud = $this->baseCRUD()
+			->filterTogglable(false)
+			->headerToolbar([
+				$this->createButton('dialog'),
+				...$this->baseHeaderToolBar()
+			])
+			->columns([
+				amis()->TableColumn('id', 'ID')->sortable(),
+				amis()->TableColumn('user_id', '用户编号'),
+				amis()->TableColumn('info_record_id', '代理商信息记录编号'),
+				amis()->TableColumn('real_auth_record_id', '代理商实名认证记录编号'),
+				amis()->TableColumn('qual_record_id', '代理商资质认证记录编号'),
+				amis()->TableColumn('state', '状态'),
+				amis()->TableColumn('created_at', admin_trans('admin.created_at'))->type('datetime')->sortable(),
+				amis()->TableColumn('updated_at', admin_trans('admin.updated_at'))->type('datetime')->sortable(),
+				$this->rowActions('dialog')
+			]);
+
+		return $this->baseList($crud);
+	}
+
+	public function form($isEdit = false)
+	{
+		return $this->baseForm()->body([
+			amis()->TextControl('user_id', '用户编号'),
+			amis()->TextControl('info_record_id', '代理商信息记录编号'),
+			amis()->TextControl('real_auth_record_id', '代理商实名认证记录编号'),
+			amis()->TextControl('qual_record_id', '代理商资质认证记录编号'),
+			amis()->TextControl('state', '状态'),
+		]);
+	}
+
+	public function detail()
+	{
+		return $this->baseDetail()->body([
+			amis()->TextControl('id', 'ID')->static(),
+			amis()->TextControl('user_id', '用户编号')->static(),
+			amis()->TextControl('info_record_id', '代理商信息记录编号')->static(),
+			amis()->TextControl('real_auth_record_id', '代理商实名认证记录编号')->static(),
+			amis()->TextControl('qual_record_id', '代理商资质认证记录编号')->static(),
+			amis()->TextControl('state', '状态')->static(),
+			amis()->TextControl('created_at', admin_trans('admin.created_at'))->static(),
+			amis()->TextControl('updated_at', admin_trans('admin.updated_at'))->static(),
+		]);
+	}
+}

+ 82 - 0
app/Admin/Controllers/AgentInfoRecordController.php

@@ -0,0 +1,82 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Services\AgentInfoRecordService;
+use Slowlyo\OwlAdmin\Controllers\AdminController;
+
+/**
+ * 代理商信息认证记录
+ *
+ * @property AgentInfoRecordService $service
+ */
+class AgentInfoRecordController extends AdminController
+{
+	protected string $serviceName = AgentInfoRecordService::class;
+
+	public function list()
+	{
+		$crud = $this->baseCRUD()
+			->filterTogglable(false)
+			->headerToolbar([
+				$this->createButton('dialog'),
+				...$this->baseHeaderToolBar()
+			])
+			->columns([
+				amis()->TableColumn('id', 'ID')->sortable(),
+				amis()->TableColumn('agent_id', '代理商编号'),
+				amis()->TableColumn('company_name', '公司名称'),
+				amis()->TableColumn('company_address', '公司地址'),
+				amis()->TableColumn('contact_name', '联系人姓名'),
+				amis()->TableColumn('contact_mobile', '联系人手机号'),
+				amis()->TableColumn('business_area', '经营区域'),
+				amis()->TableColumn('business_scope', '经营范围'),
+				amis()->TableColumn('auditor', '审核人'),
+				amis()->TableColumn('audit_time', '审核时间'),
+				amis()->TableColumn('audit_remark', '审核回执'),
+				amis()->TableColumn('state', '状态'),
+				amis()->TableColumn('created_at', admin_trans('admin.created_at'))->type('datetime')->sortable(),
+				amis()->TableColumn('updated_at', admin_trans('admin.updated_at'))->type('datetime')->sortable(),
+				$this->rowActions('dialog')
+			]);
+
+		return $this->baseList($crud);
+	}
+
+	public function form($isEdit = false)
+	{
+		return $this->baseForm()->body([
+			amis()->TextControl('agent_id', '代理商编号'),
+			amis()->TextControl('company_name', '公司名称'),
+			amis()->TextControl('company_address', '公司地址'),
+			amis()->TextControl('contact_name', '联系人姓名'),
+			amis()->TextControl('contact_mobile', '联系人手机号'),
+			amis()->TextControl('business_area', '经营区域'),
+			amis()->TextControl('business_scope', '经营范围'),
+			amis()->TextControl('auditor', '审核人'),
+			amis()->TextControl('audit_time', '审核时间'),
+			amis()->TextControl('audit_remark', '审核回执'),
+			amis()->TextControl('state', '状态'),
+		]);
+	}
+
+	public function detail()
+	{
+		return $this->baseDetail()->body([
+			amis()->TextControl('id', 'ID')->static(),
+			amis()->TextControl('agent_id', '代理商编号')->static(),
+			amis()->TextControl('company_name', '公司名称')->static(),
+			amis()->TextControl('company_address', '公司地址')->static(),
+			amis()->TextControl('contact_name', '联系人姓名')->static(),
+			amis()->TextControl('contact_mobile', '联系人手机号')->static(),
+			amis()->TextControl('business_area', '经营区域')->static(),
+			amis()->TextControl('business_scope', '经营范围')->static(),
+			amis()->TextControl('auditor', '审核人')->static(),
+			amis()->TextControl('audit_time', '审核时间')->static(),
+			amis()->TextControl('audit_remark', '审核回执')->static(),
+			amis()->TextControl('state', '状态')->static(),
+			amis()->TextControl('created_at', admin_trans('admin.created_at'))->static(),
+			amis()->TextControl('updated_at', admin_trans('admin.updated_at'))->static(),
+		]);
+	}
+}

+ 79 - 0
app/Admin/Controllers/AgentRealAuthRecordController.php

@@ -0,0 +1,79 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Services\AgentRealAuthRecordService;
+use Slowlyo\OwlAdmin\Controllers\AdminController;
+
+/**
+ * 代理商实名认证记录
+ *
+ * @property AgentRealAuthRecordService $service
+ */
+class AgentRealAuthRecordController extends AdminController
+{
+	protected string $serviceName = AgentRealAuthRecordService::class;
+
+	public function list()
+	{
+		$crud = $this->baseCRUD()
+			->filterTogglable(false)
+			->headerToolbar([
+				$this->createButton('dialog'),
+				...$this->baseHeaderToolBar()
+			])
+			->columns([
+				amis()->TableColumn('id', 'ID')->sortable(),
+				amis()->TableColumn('agent_id', '代理商编号'),
+				amis()->TableColumn('real_name', '法人姓名'),
+				amis()->TableColumn('id_card', '法人身份证号'),
+				amis()->TableColumn('id_card_front_photo', '法人身份证正面照片'),
+				amis()->TableColumn('id_card_back_photo', '法人身份证反面照片'),
+				amis()->TableColumn('business_license', '营业执照照片'),
+				amis()->TableColumn('auditor', '审核人'),
+				amis()->TableColumn('audit_time', '审核时间'),
+				amis()->TableColumn('audit_remark', '审核回执'),
+				amis()->TableColumn('state', '状态'),
+				amis()->TableColumn('created_at', admin_trans('admin.created_at'))->type('datetime')->sortable(),
+				amis()->TableColumn('updated_at', admin_trans('admin.updated_at'))->type('datetime')->sortable(),
+				$this->rowActions('dialog')
+			]);
+
+		return $this->baseList($crud);
+	}
+
+	public function form($isEdit = false)
+	{
+		return $this->baseForm()->body([
+			amis()->TextControl('agent_id', '代理商编号'),
+			amis()->TextControl('real_name', '法人姓名'),
+			amis()->TextControl('id_card', '法人身份证号'),
+			amis()->TextControl('id_card_front_photo', '法人身份证正面照片'),
+			amis()->TextControl('id_card_back_photo', '法人身份证反面照片'),
+			amis()->TextControl('business_license', '营业执照照片'),
+			amis()->TextControl('auditor', '审核人'),
+			amis()->TextControl('audit_time', '审核时间'),
+			amis()->TextControl('audit_remark', '审核回执'),
+			amis()->TextControl('state', '状态'),
+		]);
+	}
+
+	public function detail()
+	{
+		return $this->baseDetail()->body([
+			amis()->TextControl('id', 'ID')->static(),
+			amis()->TextControl('agent_id', '代理商编号')->static(),
+			amis()->TextControl('real_name', '法人姓名')->static(),
+			amis()->TextControl('id_card', '法人身份证号')->static(),
+			amis()->TextControl('id_card_front_photo', '法人身份证正面照片')->static(),
+			amis()->TextControl('id_card_back_photo', '法人身份证反面照片')->static(),
+			amis()->TextControl('business_license', '营业执照照片')->static(),
+			amis()->TextControl('auditor', '审核人')->static(),
+			amis()->TextControl('audit_time', '审核时间')->static(),
+			amis()->TextControl('audit_remark', '审核回执')->static(),
+			amis()->TextControl('state', '状态')->static(),
+			amis()->TextControl('created_at', admin_trans('admin.created_at'))->static(),
+			amis()->TextControl('updated_at', admin_trans('admin.updated_at'))->static(),
+		]);
+	}
+}

+ 82 - 0
app/Admin/Controllers/SysRegionController.php

@@ -0,0 +1,82 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Services\SysRegionService;
+use Slowlyo\OwlAdmin\Controllers\AdminController;
+
+/**
+ * 行政区划
+ *
+ * @property SysRegionService $service
+ */
+class SysRegionController extends AdminController
+{
+	protected string $serviceName = SysRegionService::class;
+
+	public function list()
+	{
+		$crud = $this->baseCRUD()
+			->filterTogglable(false)
+			->headerToolbar([
+				$this->createButton('dialog'),
+				...$this->baseHeaderToolBar()
+			])
+			->columns([
+				amis()->TableColumn('id', 'ID')->sortable(),
+				amis()->TableColumn('cityName', 'CityName'),
+				amis()->TableColumn('parentId', 'ParentId')->sortable(),
+				amis()->TableColumn('shortName', 'ShortName'),
+				amis()->TableColumn('depth', 'Depth')->sortable(),
+				amis()->TableColumn('cityCode', 'CityCode'),
+				amis()->TableColumn('zipCode', 'ZipCode'),
+				amis()->TableColumn('mergerName', 'MergerName'),
+				amis()->TableColumn('longitude', 'Longitude'),
+				amis()->TableColumn('latitude', 'Latitude'),
+				amis()->TableColumn('pinyin', 'Pinyin'),
+				amis()->TableColumn('isUse', 'IsUse'),
+				amis()->TableColumn('created_at', admin_trans('admin.created_at'))->type('datetime')->sortable(),
+				amis()->TableColumn('updated_at', admin_trans('admin.updated_at'))->type('datetime')->sortable(),
+				$this->rowActions('dialog')
+			]);
+
+		return $this->baseList($crud);
+	}
+
+	public function form($isEdit = false)
+	{
+		return $this->baseForm()->body([
+			amis()->TextControl('cityName', 'CityName'),
+			amis()->TextControl('parentId', 'ParentId'),
+			amis()->TextControl('shortName', 'ShortName'),
+			amis()->TextControl('depth', 'Depth'),
+			amis()->TextControl('cityCode', 'CityCode'),
+			amis()->TextControl('zipCode', 'ZipCode'),
+			amis()->TextControl('mergerName', 'MergerName'),
+			amis()->TextControl('longitude', 'Longitude'),
+			amis()->TextControl('latitude', 'Latitude'),
+			amis()->TextControl('pinyin', 'Pinyin'),
+			amis()->TextControl('isUse', 'IsUse'),
+		]);
+	}
+
+	public function detail()
+	{
+		return $this->baseDetail()->body([
+			amis()->TextControl('id', 'ID')->static(),
+			amis()->TextControl('cityName', 'CityName')->static(),
+			amis()->TextControl('parentId', 'ParentId')->static(),
+			amis()->TextControl('shortName', 'ShortName')->static(),
+			amis()->TextControl('depth', 'Depth')->static(),
+			amis()->TextControl('cityCode', 'CityCode')->static(),
+			amis()->TextControl('zipCode', 'ZipCode')->static(),
+			amis()->TextControl('mergerName', 'MergerName')->static(),
+			amis()->TextControl('longitude', 'Longitude')->static(),
+			amis()->TextControl('latitude', 'Latitude')->static(),
+			amis()->TextControl('pinyin', 'Pinyin')->static(),
+			amis()->TextControl('isUse', 'IsUse')->static(),
+			amis()->TextControl('created_at', admin_trans('admin.created_at'))->static(),
+			amis()->TextControl('updated_at', admin_trans('admin.updated_at'))->static(),
+		]);
+	}
+}

+ 16 - 0
app/Models/AgentInfo.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\SoftDeletes;
+use Slowlyo\OwlAdmin\Models\BaseModel as Model;
+
+/**
+ * 代理商
+ */
+class AgentInfo extends Model
+{
+	use SoftDeletes;
+
+	protected $table = 'agent_infos';
+}

+ 16 - 0
app/Models/AgentInfoRecord.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\SoftDeletes;
+use Slowlyo\OwlAdmin\Models\BaseModel as Model;
+
+/**
+ * 代理商信息认证记录
+ */
+class AgentInfoRecord extends Model
+{
+	use SoftDeletes;
+
+	protected $table = 'agent_info_records';
+}

+ 16 - 0
app/Models/AgentRealAuthRecord.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\SoftDeletes;
+use Slowlyo\OwlAdmin\Models\BaseModel as Model;
+
+/**
+ * 代理商实名认证记录
+ */
+class AgentRealAuthRecord extends Model
+{
+	use SoftDeletes;
+
+	protected $table = 'agent_real_auth_records';
+}

+ 12 - 2
app/Models/MemberUser.php

@@ -13,6 +13,16 @@ class MemberUser extends Model
 	use SoftDeletes;
 
 	protected $table = 'member_users';
+	protected $hidden = ['password'];
 
-	
-}
+	protected static function booted()
+	{
+		static::created(function ($user) {
+			$user->wallet()->create([
+				'owner_type' => MemberUser::class,
+				'owner_id' => $user->id
+			]);
+		});
+	}
+
+}

+ 16 - 0
app/Models/SysRegion.php

@@ -0,0 +1,16 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\SoftDeletes;
+use Slowlyo\OwlAdmin\Models\BaseModel as Model;
+
+/**
+ * 行政区划
+ */
+class SysRegion extends Model
+{
+	use SoftDeletes;
+
+	protected $table = 'sys_region';
+}

+ 6 - 1
app/Models/Wallet.php

@@ -13,4 +13,9 @@ class Wallet extends Model
 	use SoftDeletes;
 
 	protected $table = 'wallet';
-}
+
+	protected $fillable = [
+        'owner_type', // 添加这一行以允许 mass assignment
+    ];
+
+}

+ 17 - 0
app/Services/AgentInfoRecordService.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Services;
+
+use App\Models\AgentInfoRecord;
+use Slowlyo\OwlAdmin\Services\AdminService;
+
+/**
+ * 代理商信息认证记录
+ *
+ * @method AgentInfoRecord getModel()
+ * @method AgentInfoRecord|\Illuminate\Database\Query\Builder query()
+ */
+class AgentInfoRecordService extends AdminService
+{
+	protected string $modelName = AgentInfoRecord::class;
+}

+ 17 - 0
app/Services/AgentInfoService.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Services;
+
+use App\Models\AgentInfo;
+use Slowlyo\OwlAdmin\Services\AdminService;
+
+/**
+ * 代理商
+ *
+ * @method AgentInfo getModel()
+ * @method AgentInfo|\Illuminate\Database\Query\Builder query()
+ */
+class AgentInfoService extends AdminService
+{
+	protected string $modelName = AgentInfo::class;
+}

+ 17 - 0
app/Services/AgentRealAuthRecordService.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Services;
+
+use App\Models\AgentRealAuthRecord;
+use Slowlyo\OwlAdmin\Services\AdminService;
+
+/**
+ * 代理商实名认证记录
+ *
+ * @method AgentRealAuthRecord getModel()
+ * @method AgentRealAuthRecord|\Illuminate\Database\Query\Builder query()
+ */
+class AgentRealAuthRecordService extends AdminService
+{
+	protected string $modelName = AgentRealAuthRecord::class;
+}

+ 19 - 1
app/Services/MemberUserService.php

@@ -3,6 +3,7 @@
 namespace App\Services;
 
 use App\Models\MemberUser;
+use Illuminate\Support\Facades\DB;
 use Slowlyo\OwlAdmin\Services\AdminService;
 
 /**
@@ -14,4 +15,21 @@ use Slowlyo\OwlAdmin\Services\AdminService;
 class MemberUserService extends AdminService
 {
 	protected string $modelName = MemberUser::class;
-}
+
+	public function list()
+	{
+		$data = parent::list();
+		$userState = admin_dict()->getAll('user_status');
+		$userGender = admin_dict()->getAll('user_gender');
+
+		collect($data['items'])->each(function ($item) use ($userState, $userGender) {
+			$item->state = $userState[$item->state]['value'] ?? $item->state;
+			$item->gender = $userGender[$item->gender]['value'] ?? $item->gender;
+			$districtRegion = $item->load('region')->region;
+			unset($item->region);
+			$item->register_area = $districtRegion->mergerName ?? $item->register_area;
+		});
+        return $data;
+	}
+
+}

+ 17 - 0
app/Services/SysRegionService.php

@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Services;
+
+use App\Models\SysRegion;
+use Slowlyo\OwlAdmin\Services\AdminService;
+
+/**
+ * 行政区划
+ *
+ * @method SysRegion getModel()
+ * @method SysRegion|\Illuminate\Database\Query\Builder query()
+ */
+class SysRegionService extends AdminService
+{
+	protected string $modelName = SysRegion::class;
+}

+ 13 - 0
app/Services/WalletService.php

@@ -14,4 +14,17 @@ use Slowlyo\OwlAdmin\Services\AdminService;
 class WalletService extends AdminService
 {
 	protected string $modelName = Wallet::class;
+
+	public function list()
+	{
+		$data = parent::list();
+		$userState = admin_dict()->getAll('user_status');
+		$walletType = admin_dict()->getAll('wallet_type');
+		collect($data['items'])->each(function ($item) use ($userState, $walletType) {
+			$item->state = $userState[$item->state]['value'] ?? $item->state;
+			$item->owner_type = $walletType[$item->owner_type]['value'] ?? $item->owner_type;
+			$item->load('member');
+		});
+        return $data;
+	}
 }

+ 0 - 2
database/migrations/2024_11_14_085358_create_wallet_trans_records_table.php

@@ -29,8 +29,6 @@ return new class extends Migration
             $table->dateTime('trans_time')->comment('交易时间');
             $table->string('remark')->nullable()->comment('备注');
             $table->string('state')->default('')->comment('交易状态(processing:进行中 success:成功 fail:失败 cancel:取消)');
-            $table->dateTime('create_time')->default('CURRENT_TIMESTAMP')->comment('创建时间');
-            $table->dateTime('update_time')->default('CURRENT_TIMESTAMP')->comment('更新时间');
             $table->timestamps();
             $table->softDeletes();
         });

+ 1 - 1
database/migrations/2024_11_14_103213_create_wallet_payment_records_table.php

@@ -25,7 +25,7 @@ return new class extends Migration
             $table->decimal('actual_amount')->comment('实际支付金额');
             $table->decimal('used_wallet_balance')->comment('使用钱包余额');
             $table->decimal('used_recharge_balance')->comment('使用充值余额');
-            $table->timestamp('payment_time')->default('CURRENT_TIMESTAMP')->comment('支付时间');
+            $table->timestamp('payment_time')->nullable()->comment('支付时间');
             $table->string('remark')->nullable()->comment('备注');
             $table->string('state')->default('pending')->comment('状态');
             $table->timestamps();

+ 1 - 1
database/migrations/2024_11_14_104039_create_wallet_refund_records_table.php

@@ -25,7 +25,7 @@ return new class extends Migration
             $table->decimal('actual_refund_amount')->comment('实际退款金额');
             $table->decimal('wallet_balance_refund_amount')->comment('钱包余额退款金额');
             $table->decimal('recharge_balance_refund_amount')->comment('充值余额退款金额');
-            $table->timestamp('refund_time')->default('CURRENT_TIMESTAMP')->comment('退款时间');
+            $table->timestamp('refund_time')->nullable()->comment('退款时间');
             $table->string('remark')->nullable()->comment('备注');
             $table->string('state')->default('pending')->comment('状态');
             $table->timestamps();

+ 1 - 1
database/migrations/2024_11_14_104843_create_wallet_split_records_table.php

@@ -22,7 +22,7 @@ return new class extends Migration
             $table->decimal('amount')->comment('参与分账金额');
             $table->decimal('split_ratio')->comment('分账比例');
             $table->decimal('split_amount')->comment('分账金额');
-            $table->timestamp('entry_time')->default('CURRENT_TIMESTAMP')->comment('入账时间');
+            $table->timestamp('entry_time')->nullable()->comment('入账时间');
             $table->string('remark')->nullable()->comment('入账备注');
             $table->string('state')->default('pending')->comment('状态');
             $table->timestamps();

+ 38 - 0
database/migrations/2024_11_15_040819_create_agent_infos_table.php

@@ -0,0 +1,38 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('agent_infos', function (Blueprint $table) {
+            $table->comment('代理商');
+            $table->increments('id');
+            $table->unsignedBigInteger('user_id')->comment('用户编号');
+            $table->unsignedBigInteger('info_record_id')->nullable()->comment('代理商信息记录编号');
+            $table->unsignedBigInteger('real_auth_record_id')->nullable()->comment('代理商实名认证记录编号');
+            $table->unsignedBigInteger('qual_record_id')->nullable()->comment('代理商资质认证记录编号');
+            $table->string('state')->default('ENABLE')->comment('状态');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('agent_infos');
+    }
+};

+ 44 - 0
database/migrations/2024_11_15_041123_create_agent_info_records_table.php

@@ -0,0 +1,44 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('agent_info_records', function (Blueprint $table) {
+            $table->comment('代理商信息认证记录');
+            $table->increments('id');
+            $table->unsignedBigInteger('agent_id')->comment('代理商编号');
+            $table->string('company_name')->default('')->comment('公司名称');
+            $table->string('company_address')->default('')->comment('公司地址');
+            $table->string('contact_name')->default('')->comment('联系人姓名');
+            $table->string('contact_mobile')->default('')->comment('联系人手机号');
+            $table->string('business_area')->default('')->comment('经营区域');
+            $table->string('business_scope')->default('')->comment('经营范围');
+            $table->string('auditor')->nullable()->comment('审核人');
+            $table->timestamp('audit_time')->nullable()->comment('审核时间');
+            $table->string('audit_remark')->nullable()->comment('审核回执');
+            $table->string('state')->default('PENDING')->comment('状态');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('agent_info_records');
+    }
+};

+ 43 - 0
database/migrations/2024_11_15_041634_create_agent_real_auth_records_table.php

@@ -0,0 +1,43 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('agent_real_auth_records', function (Blueprint $table) {
+            $table->comment('代理商实名认证记录');
+            $table->increments('id');
+            $table->unsignedBigInteger('agent_id')->comment('代理商编号');
+            $table->string('real_name')->default('')->comment('法人姓名');
+            $table->string('id_card')->default('')->comment('法人身份证号');
+            $table->string('id_card_front_photo')->default('')->comment('法人身份证正面照片');
+            $table->string('id_card_back_photo')->default('')->comment('法人身份证反面照片');
+            $table->string('business_license')->default('')->comment('营业执照照片');
+            $table->string('auditor')->nullable()->comment('审核人');
+            $table->timestamp('audit_time')->nullable()->comment('审核时间');
+            $table->string('audit_remark')->nullable()->comment('审核回执');
+            $table->string('state')->default('PENDING')->comment('状态');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('agent_real_auth_records');
+    }
+};

+ 44 - 0
database/migrations/2024_11_15_093359_create_sys_region_table.php

@@ -0,0 +1,44 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::create('sys_region', function (Blueprint $table) {
+            $table->comment('行政区划');
+            $table->increments('id');
+            $table->string('cityName')->default('');
+            $table->integer('parentId');
+            $table->string('shortName')->default('');
+            $table->integer('depth');
+            $table->string('cityCode')->default('');
+            $table->string('zipCode')->default('');
+            $table->string('mergerName')->default('');
+            $table->string('longitude')->default('');
+            $table->string('latitude')->default('');
+            $table->string('pinyin')->default('');
+            $table->unsignedInteger('isUse')->nullable();
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::dropIfExists('sys_region');
+    }
+};

+ 6 - 0
routes/admin.php

@@ -71,5 +71,11 @@ Route::group([
     $router->resource('shop_services', \App\Admin\Controllers\ShopServiceController::class);
     // 店铺技师服务项目
     $router->resource('shop_coach_services', \App\Admin\Controllers\ShopCoachServiceController::class);
+    // 代理商
+    $router->resource('agent_infos', \App\Admin\Controllers\AgentInfoController::class);
+    // 代理商信息认证记录
+    $router->resource('agent_info_records', \App\Admin\Controllers\AgentInfoRecordController::class);
+    // 代理商实名认证记录
+    $router->resource('agent_real_auth_records', \App\Admin\Controllers\AgentRealAuthRecordController::class);
 
 });