Browse Source

入驻协议

master
李可松 4 years ago
parent
commit
44528a2f97
  1. 3
      MySQL_change.sql
  2. 7
      app/Admin/Forms/Setting.php
  3. 19
      app/AdminSettled/Controllers/SupplierController.php
  4. 1
      resources/lang/zh_CN/supplier.php

3
MySQL_change.sql

@ -230,4 +230,5 @@ ALTER TABLE `suppliers`
ADD COLUMN `license` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '许可证' AFTER `business_license`,
ADD COLUMN `credit_codes` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '统一社会信用代码' COLLATE 'utf8_general_ci' AFTER `license`,
ADD COLUMN `corporate_account` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '对公账号' AFTER `credit_codes`,
ADD COLUMN `deposit_bank` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '开户行' AFTER `corporate_account`;
ADD COLUMN `deposit_bank` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '开户行' AFTER `corporate_account`,
ADD COLUMN `contract` VARCHAR(255) NOT NULL DEFAULT '' COMMENT '入驻合同' AFTER `deposit_bank`;

7
app/Admin/Forms/Setting.php

@ -28,7 +28,12 @@ class Setting extends Form
*/
public function form()
{
$this->tab('支付小程序配置', function () {
$this->tab('入驻配置', function () {
$this->file('settled_supplier_contract', '供应商入驻合同')->uniqueName()->autoUpload()->required()
->help('建议为doc/docx/pdf格式,供应商可在入驻页面下载后打印');
$this->file('settled_supplier_agreement', '供应商入驻协议')->uniqueName()->autoUpload()->required()
->help('建议为doc/docx/pdf格式,供应商可在入驻页面下载后查看');
})->tab('支付小程序配置', function () {
$this->text('payee_appid', '收款小程序APPID')->required();
$this->text('payee_appsecret', '收款小程序APP_SECRET')->required();
$this->text('payee_mchid', '收款小程序MCH_ID')->required();

19
app/AdminSettled/Controllers/SupplierController.php

@ -4,11 +4,13 @@ namespace App\AdminSettled\Controllers;
use App\Admin\Repositories\Supplier;
use App\Common\UserStatus;
use App\Models\AdminSetting;
use Dcat\Admin\Admin;
use Dcat\Admin\Form;
use Dcat\Admin\Http\Controllers\AdminController;
use Dcat\Admin\Widgets\Alert;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
class SupplierController extends AdminController
{
@ -68,11 +70,28 @@ class SupplierController extends AdminController
$form->text('deposit_bank')->required();
$form->text('director')->required();
$form->text('contact_phone')->required()->maxLength(13);
$contract_template = Storage::disk('public')->url(AdminSetting::val('settled_supplier_contract'));
$form->image('contract')->required()
->help('请先 <a target="_blank" href="' . $contract_template . '" download="【易游天下】供应商入驻合同模板">下载入驻合同</a> 并打印,填写完毕之后盖好公章再上传。');
$agreement_template = Storage::disk('public')->url(AdminSetting::val('settled_supplier_agreement'));
$form->checkbox('agreement', '')->required()
->options([1 => '我已认真阅读并完全认同'])->customFormat(fn() => '1111111')
->script('$(function(){
$(".field_agreement").parent().css("margin-right", 0).after(\'《<a target="_blank" href="'.$agreement_template.'" download="入驻协议">入驻协议</a>》\');
});');
})->saving(function (Form $form) {
if ($form->isEditing()) {
return $form->response()->error('服务器出错了~~');
}
if (empty(array_filter($form->agreement))) {
return $form->response()->error('你必须同意入驻协议才能入驻');
}
$form->deleteInput('agreement');
//判断账号是否唯一
if ($form->repository()->model()->where('username', $form->username)->exists()) {
return $form->response()->error($form->username . ' 的账号已经存在');

1
resources/lang/zh_CN/supplier.php

@ -21,6 +21,7 @@ return [
'credit_codes' => '统一社会信用代码',
'corporate_account' => '对公账号',
'deposit_bank' => '对公账号开户行',
'contract' => '入驻合同',
],
'options' => [
],

Loading…
Cancel
Save