Browse Source

代理商增加许可证license

master
李可松 4 years ago
parent
commit
212df4f357
  1. 5
      MySQL_change.sql
  2. 15
      app/Admin/Controllers/AgentController.php
  3. 22
      app/AdminAgent/Forms/AgentInfo.php
  4. 6
      app/AdminSettled/Controllers/AgentController.php
  5. 4
      app/AdminSupplier/Forms/SupplierInfo.php
  6. 1
      app/Models/Agent.php
  7. 3
      resources/lang/zh_CN/agent.php

5
MySQL_change.sql

@ -361,3 +361,8 @@ ALTER TABLE `statement`
ALTER TABLE `suppliers` ALTER TABLE `suppliers`
CHANGE COLUMN `license` `license` VARCHAR(1024) NOT NULL DEFAULT '' COMMENT '许可证' COLLATE 'utf8mb4_general_ci' AFTER `business_license`; CHANGE COLUMN `license` `license` VARCHAR(1024) NOT NULL DEFAULT '' COMMENT '许可证' COLLATE 'utf8mb4_general_ci' AFTER `business_license`;
# 0:35 ‎2021/‎10/‎22 代理商增加license
ALTER TABLE `agents`
ADD COLUMN `license` VARCHAR(1024) NOT NULL DEFAULT '' COMMENT '许可证' COLLATE 'utf8mb4_general_ci' AFTER `business_license`,
ADD COLUMN `corporate_account` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '对公账号' COLLATE 'utf8mb4_general_ci' AFTER `license`,
ADD COLUMN `deposit_bank` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '开户行' COLLATE 'utf8mb4_general_ci' AFTER `corporate_account`;

15
app/Admin/Controllers/AgentController.php

@ -37,7 +37,7 @@ class AgentController extends AdminController
$grid->column('username'); $grid->column('username');
$grid->column('type')->using(AgentType::array()); $grid->column('type')->using(AgentType::array());
$grid->column('company_name'); $grid->column('company_name');
$grid->column('logo')->image('', 60, 60);
$grid->column('license')->image('', 60, 60);
$grid->column('address'); $grid->column('address');
$grid->column('business_license')->image('', 60, 60); $grid->column('business_license')->image('', 60, 60);
$grid->column('director'); $grid->column('director');
@ -93,7 +93,7 @@ class AgentController extends AdminController
$show->field('type')->using(AgentType::array()); $show->field('type')->using(AgentType::array());
$show->field('company_name'); $show->field('company_name');
$show->field('credit_codes'); $show->field('credit_codes');
$show->field('logo')->image('', 80, 80);
$show->field('license')->image('', 80, 80);
$show->field('address'); $show->field('address');
$show->field('business_license')->image('', 80, 80); $show->field('business_license')->image('', 80, 80);
$show->field('director'); $show->field('director');
@ -104,17 +104,17 @@ class AgentController extends AdminController
$show->field('agentInfo.about', '关于我们') $show->field('agentInfo.about', '关于我们')
->unescape() ->unescape()
->as(function ($v) { ->as(function ($v) {
return preg_replace('/<script.*?>.*?<\/script>/is', '', $this->agentInfo->about);
return preg_replace('/<script.*?>.*?<\/script>/is', '', $this->agentInfo->about ?? '');
}); });
$show->field('agentInfo.reg_protocol', '注册协议') $show->field('agentInfo.reg_protocol', '注册协议')
->unescape() ->unescape()
->as(function ($v) { ->as(function ($v) {
return preg_replace('/<script.*?>.*?<\/script>/is', '', $this->agentInfo->reg_protocol);
return preg_replace('/<script.*?>.*?<\/script>/is', '', $this->agentInfo->reg_protocol ?? '');
}); });
$show->field('agentInfo.buy_protocol', '购买协议') $show->field('agentInfo.buy_protocol', '购买协议')
->unescape() ->unescape()
->as(function ($v) { ->as(function ($v) {
return preg_replace('/<script.*?>.*?<\/script>/is', '', $this->agentInfo->buy_protocol);
return preg_replace('/<script.*?>.*?<\/script>/is', '', $this->agentInfo->buy_protocol ?? '');
}); });
$show->field('created_at'); $show->field('created_at');
$show->field('updated_at'); $show->field('updated_at');
@ -156,9 +156,9 @@ class AgentController extends AdminController
->required(); ->required();
$form->text('company_name')->required()->help('请正确填写,保持跟营业执照上的完全一致,如:海南易游天下供应链有限公司'); $form->text('company_name')->required()->help('请正确填写,保持跟营业执照上的完全一致,如:海南易游天下供应链有限公司');
$form->text('credit_codes')->required()->help('请正确填写,保持跟营业执照上的完全一致,如:91440300577652919M'); $form->text('credit_codes')->required()->help('请正确填写,保持跟营业执照上的完全一致,如:91440300577652919M');
$form->text('address');
$form->distpicker(['province_id', 'city_id', 'area_id'], '请选择区域')->required(); $form->distpicker(['province_id', 'city_id', 'area_id'], '请选择区域')->required();
$form->image('logo')->removable(false)->uniqueName();
$form->text('address');
$form->multipleImage('license')->removable(false)->uniqueName();
$form->image('business_license')->removable(false)->uniqueName(); $form->image('business_license')->removable(false)->uniqueName();
$form->text('director'); $form->text('director');
$form->text('contact_phone'); $form->text('contact_phone');
@ -220,6 +220,7 @@ class AgentController extends AdminController
'status' => $form->model()->status, 'status' => $form->model()->status,
'company_name' => $form->model()->company_name, 'company_name' => $form->model()->company_name,
'logo' => $form->model()->logo, 'logo' => $form->model()->logo,
'license' => $form->model()->license,
'address' => $form->model()->address, 'address' => $form->model()->address,
'business_license' => $form->model()->business_license, 'business_license' => $form->model()->business_license,
'director' => $form->model()->director, 'director' => $form->model()->director,

22
app/AdminAgent/Forms/AgentInfo.php

@ -28,12 +28,12 @@ class AgentInfo extends Form
//$model->address = $input['address']; //$model->address = $input['address'];
$model->director = $input['director']; $model->director = $input['director'];
$model->contact_phone = $input['contact_phone']; $model->contact_phone = $input['contact_phone'];
$model->logo = $input['logo'];
// $model->logo = $input['logo'];
$model->avatar = $input['avatar']; $model->avatar = $input['avatar'];
//$model->business_license = $input['business_license']; //$model->business_license = $input['business_license'];
//$model->legal_persona_name = $input['legal_persona_name']; //$model->legal_persona_name = $input['legal_persona_name'];
$model->legal_persona_wechat = $input['legal_persona_wechat']; $model->legal_persona_wechat = $input['legal_persona_wechat'];
$model->status = UserStatus::UNAUDITED;
// $model->status = UserStatus::UNAUDITED;
$model->agentInfo->about = $input['agentInfo']['about']; $model->agentInfo->about = $input['agentInfo']['about'];
$model->agentInfo->reg_protocol = $input['agentInfo']['reg_protocol']; $model->agentInfo->reg_protocol = $input['agentInfo']['reg_protocol'];
@ -51,18 +51,18 @@ class AgentInfo extends Form
{ {
Admin::translation('agent'); Admin::translation('agent');
$this->select('type')->options(AgentType::array())->disable();
$this->display('type')->customFormat(fn() => AgentType::array()[$this->type] ?? '');
$this->display('company_name')->required();
$this->display('province.name','省份');
$this->display('city.name','城市');
$this->display('area.name','地区');
$this->display('credit_codes')->required();
$this->display('address')->required();
$this->text('name')->required(); $this->text('name')->required();
$this->text('company_name')->required()->disable();
$this->text('province.name','省份')->disable();
$this->text('city.name','城市')->disable();
$this->text('area.name','地区')->disable();
$this->text('credit_codes')->required()->disable();
$this->text('address')->required()->disable();
$this->text('director')->required(); $this->text('director')->required();
$this->text('contact_phone')->required(); $this->text('contact_phone')->required();
$this->image('logo')->required();
$this->image('license')->required()->disable();
$this->image('avatar'); $this->image('avatar');
$this->image('business_license')->required()->disable(); $this->image('business_license')->required()->disable();
$this->text('legal_persona_name')->required()->disable(); $this->text('legal_persona_name')->required()->disable();
@ -72,7 +72,7 @@ class AgentInfo extends Form
$this->editor('agentInfo.reg_protocol')->required(); $this->editor('agentInfo.reg_protocol')->required();
$this->editor('agentInfo.buy_protocol')->required(); $this->editor('agentInfo.buy_protocol')->required();
$this->confirm('编辑确认', '编辑内容需要管理员重新审核,确定要提交吗?');
// $this->confirm('编辑确认', '编辑内容需要管理员重新审核,确定要提交吗?');
} }
/** /**

6
app/AdminSettled/Controllers/AgentController.php

@ -71,10 +71,12 @@ class AgentController extends AdminController
->required(); ->required();
$form->text('company_name')->required()->help('请正确填写,保持跟营业执照上的完全一致,如:海南易游天下供应链有限公司'); $form->text('company_name')->required()->help('请正确填写,保持跟营业执照上的完全一致,如:海南易游天下供应链有限公司');
$form->text('credit_codes')->required()->help('请正确填写,保持跟营业执照上的完全一致,如:91440300577652919M'); $form->text('credit_codes')->required()->help('请正确填写,保持跟营业执照上的完全一致,如:91440300577652919M');
$form->text('address')->required();
$form->distpicker(['province_id', 'city_id', 'area_id'], '请选择区域')->required(); $form->distpicker(['province_id', 'city_id', 'area_id'], '请选择区域')->required();
$form->image('logo')->required()->removable(false)->uniqueName();
$form->text('address')->required();
$form->multipleImage('license')->required()->removable(false)->uniqueName();
$form->image('business_license')->required()->removable(false)->uniqueName(); $form->image('business_license')->required()->removable(false)->uniqueName();
$form->text('corporate_account')->required();
$form->text('deposit_bank')->required();
$form->text('director')->required(); $form->text('director')->required();
$form->text('contact_phone')->required()->maxLength(13); $form->text('contact_phone')->required()->maxLength(13);
$form->text('legal_persona_name')->required()->maxLength(20)->help('很重要,注册小程序时需要用到,用于实名认证'); $form->text('legal_persona_name')->required()->maxLength(20)->help('很重要,注册小程序时需要用到,用于实名认证');

4
app/AdminSupplier/Forms/SupplierInfo.php

@ -29,7 +29,7 @@ class SupplierInfo extends Form
$model->avatar = $input['avatar']; $model->avatar = $input['avatar'];
// $model->license = $input['license']; // $model->license = $input['license'];
//$model->business_license = $input['business_license']; //$model->business_license = $input['business_license'];
$model->status = UserStatus::UNAUDITED;
// $model->status = UserStatus::UNAUDITED;
$model->save(); $model->save();
return $this->response()->success('保存成功')->refresh(); return $this->response()->success('保存成功')->refresh();
@ -57,7 +57,7 @@ class SupplierInfo extends Form
$this->multipleImage('license')->required()->disable(); $this->multipleImage('license')->required()->disable();
$this->image('business_license')->required()->disable(); $this->image('business_license')->required()->disable();
$this->confirm('编辑确认', '编辑内容需要管理员重新审核,确定要提交吗?');
// $this->confirm('编辑确认', '编辑内容需要管理员重新审核,确定要提交吗?');
} }
/** /**

1
app/Models/Agent.php

@ -9,6 +9,7 @@ class Agent extends BaseModel
{ {
use HasFactory, SoftDeletes; use HasFactory, SoftDeletes;
protected $casts = ['license' => 'json'];
protected $table = 'agents'; protected $table = 'agents';
public function agentInfo() public function agentInfo()

3
resources/lang/zh_CN/agent.php

@ -21,6 +21,9 @@ return [
'company_name' => '公司名称', 'company_name' => '公司名称',
'credit_codes' => '统一社会信用代码', 'credit_codes' => '统一社会信用代码',
'logo' => 'LOGO', 'logo' => 'LOGO',
'license' => '许可证',
'corporate_account' => '对公账号',
'deposit_bank' => '对公账号开户行',
'address' => '公司地址', 'address' => '公司地址',
'business_license' => '营业执照', 'business_license' => '营业执照',
'director' => '负责人', 'director' => '负责人',

Loading…
Cancel
Save