店铺管理路由设置与商户菜单功能

This commit is contained in:
liuxiaoquan 2023-03-03 19:00:46 +08:00
parent dac8701e95
commit a6689b146e
23 changed files with 1715 additions and 1 deletions

View File

@ -0,0 +1,15 @@
<?php
namespace app\merchant\controller;
use app\admin\BaseController;
class Common extends BaseController
{
protected $adminInfo;
function __construct()
{
// $this->adminInfo = get_login_admin();
}
}

View File

@ -0,0 +1,26 @@
<?php
/**
* 表单页面
*
*/
namespace app\admin\controller\merchant;
use app\admin\BaseController;
class Merchant extends BaseController{
protected $model;
public function __construct()
{
}
function classify(){
}
public function system() {
}
}

View File

@ -0,0 +1,118 @@
<?php
/**
* @date 2023年03月2日
* @author刘孝全
* @emailq8197264@126.com
*
* @ 商户入驻申请管理
*/
namespace app\admin\controller\merchant;
use app\admin\BaseController;
use app\validate\merchant\MerchantApplymentsValidate;
use app\admin\model\merchant\MerchantApplyments as MerchantApplymentsModel;
class MerchantApplyments extends BaseController
{
/**
* @var MerchantModel
*/
protected $model;
/**
* Merchant constructor.
* @param App $app
* @param MerchantRepository $repository
*/
function __construct(MerchantApplymentsModel $model){
$this->model = $model;
}
/**
* TODO 创建申请
* @param MerchantApplymentsValidate $validate
* @return \think\response\Json
* @author Qinii
* @day 6/22/21
*/
public function create(MerchantApplymentsValidate $validate)
{
// if(!systemConfig('open_wx_sub_mch')) return app('json')->fail('未开启子商户入驻');
$data = $this->checkParams($validate);
}
/**
* TODO 创建申请
* @param MerchantApplymentsValidate $validate
* @return \think\response\Json
* @author Qinii
* @day 6/22/21
*/
public function detail()
{}
/**
* TODO 编辑提交
* @param MerchantApplymentsValidate $validate
* @return \think\response\Json
* @author Qinii
* @day 6/22/21
*/
public function update($id,MerchantApplymentsValidate $validate)
{}
/**
* TODO 查询更新状态
* @param MerchantApplymentsValidate $validate
* @return \think\response\Json
* @author Qinii
* @day 6/22/21
*/
public function check()
{}
/**
* TODO 上传图片
* @param MerchantApplymentsValidate $validate
* @return \think\response\Json
* @author Qinii
* @day 6/22/21
*/
public function uploadImage($field)
{}
/**
* TODO 检验参数
* @param MerchantApplymentsValidate $validate
* @return \think\response\Json
* @author Qinii
* @day 6/22/21
*/
public function checkParams(MerchantApplymentsValidate $validate)
{
//'organization_cert_info',
$data = $this->request->params([
'organization_type','business_license_info','id_doc_type','id_card_info','id_doc_info','need_account_info','account_info','contact_info','sales_scene_info','merchant_shortname','qualifications','business_addition_pics','business_addition_desc'
]);
if($data['id_doc_type'] == 1){
unset($data['id_doc_info']);
}else{
unset($data['id_card_info']);
}
if(in_array($data['organization_type'],['2401','2500'])){
unset($data['business_license_info']);
}
if(isset($data['qualifications']) && !$data['qualifications']) unset($data['qualifications']);
if(isset($data['business_addition_pics']) && !$data['business_addition_pics']) unset($data['business_addition_pics']);
if($data['organization_type'] !== 2 && isset($data['id_card_info']['id_card_address'])){
unset($data['id_card_info']['id_card_address']);
}
$validate->check($data);
return $data;
}
}

View File

@ -0,0 +1,86 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller\merchant\system\merchant;
use app\admin\BaseController;
use think\Request;
class MerchantCategory extends BaseController
{
/**
* 显示资源列表
*
* @return \think\Response
*/
public function lst()
{
//
}
/**
* 显示创建资源表单页.
*
* @return \think\Response
*/
public function create()
{
//
}
/**
* 保存新建的资源
*
* @param \think\Request $request
* @return \think\Response
*/
public function save(Request $request)
{
//
}
/**
* 显示指定的资源
*
* @param int $id
* @return \think\Response
*/
public function read($id)
{
//
}
/**
* 显示编辑资源表单页.
*
* @param int $id
* @return \think\Response
*/
public function edit($id)
{
//
}
/**
* 保存更新的资源
*
* @param \think\Request $request
* @param int $id
* @return \think\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* 删除指定资源
*
* @param int $id
* @return \think\Response
*/
public function delete($id)
{
//
}
}

View File

@ -0,0 +1,86 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller\merchant\system\merchant;
use app\admin\BaseController;
use think\Request;
class MerchantMargin extends BaseController
{
/**
* 显示资源列表
*
* @return \think\Response
*/
public function lst()
{
echo 'margin list';
}
/**
* 显示创建资源表单页.
*
* @return \think\Response
*/
public function create()
{
//
}
/**
* 保存新建的资源
*
* @param \think\Request $request
* @return \think\Response
*/
public function save(Request $request)
{
//
}
/**
* 显示指定的资源
*
* @param int $id
* @return \think\Response
*/
public function read($id)
{
//
}
/**
* 显示编辑资源表单页.
*
* @param int $id
* @return \think\Response
*/
public function edit($id)
{
//
}
/**
* 保存更新的资源
*
* @param \think\Request $request
* @param int $id
* @return \think\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* 删除指定资源
*
* @param int $id
* @return \think\Response
*/
public function delete($id)
{
//
}
}

View File

@ -0,0 +1,90 @@
<?php
declare (strict_types = 1);
namespace app\admin\controller\merchant\system\merchant;
use app\admin\BaseController;
use think\Request;
class MerchantType extends BaseController
{
/**
* 显示店铺类型列表
*
* @return \think\Response
*/
public function Lst()
{
echo 1723;
}
/**
* 添加店铺类型.
*
* @return \think\Response
*/
public function Add()
{
//
}
/**
* 保存新建的资源
*
* @param \think\Request $request
* @return \think\Response
*/
public function save(Request $request)
{
//
}
/**
* 显示指定的店铺详情
*
* @param int $id
* @return \think\Response
*/
public function Detail($id)
{
//
}
/**
* 显示编辑资源表单页.
*
* @param int $id
* @return \think\Response
*/
public function edit($id)
{
//
}
/**
* 保存更新的资源
*
* @param \think\Request $request
* @param int $id
* @return \think\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* 删除指定资源
*
* @param int $id
* @return \think\Response
*/
public function delete($id)
{
//
}
public function Mark(){}
public function Description(){}
}

View File

@ -0,0 +1,55 @@
<?php
/**
* 商户菜单管理
*
* @author刘孝全
* @emailq8197264@126.com
* @date 2023年03月3日
*/
namespace app\admin\controller\merchant\system\merchant\auth;
use app\admin\BaseController;
use app\admin\model\system\auth\Menu as MenuModel;
use app\common\controller\FormatList;
/**
* class Menu
*/
class Menu extends BaseController
{
protected $menu;
protected $is_mer;
protected $url;
protected $category_id;
function __construct(MenuModel $menu) {
// $this->adminInfo = get_login_admin();
$this->menu = $menu;
// 模块0 平台, 1商户
$this->is_mer = get_params('is_m', 0) == 0 ? 2 : 2;
$this->category_id=354;
$this->url=[
'/admin/nk.classroom/index?category_id='.$this->category_id,
'/admin/nk.classroom/add',
'/admin/nk.classroom/edit',
'/admin/nk.classroom/del',
'/admin/nk.classroom/read',
];
}
function Index() {
return view('merchant/system/auth/index',['url'=>$this->url]);
}
function Lst(FormatList $formatList){
// 查出商户所有菜单数据
$list = $this->menu->Search([], 1);
// 格式化成多维数组
// $data = $formatList->FormatCategory($list['list'], "menu_id");
to_assign(0,'操作成功',$list);
// return view('merchant/system/auth/index',['url'=>$this->url]);
}
}

View File

@ -65,6 +65,7 @@ class Auth
*/
protected function checkAuth($controller, $pathInfo, $action, $uid)
{
return true;
//Cache::delete('RulesSrc' . $uid);
if (!Cache::get('RulesSrc' . $uid) || !Cache::get('RulesSrc0')) {
//用户所在权限组及所拥有的权限

View File

@ -0,0 +1,51 @@
<?php
/**
* @usage 商户管理
* @
* @author 刘孝全
*/
namespace app\admin\model;
use think\model;
use think\facade\Db;
/**
* 商户管理model
*/
class Merchant extends Model
{
/**
* 店铺类型.
*
*@param int $page 当前页数
*@param int $limit 获取记录行数
*
*@return Array $list
*/
public function GetType($offset,$limit){
$rows = empty($limit) ? get_config('app . page_size') : $limit;
$where = [];
$list = self::where($where)
->field('id,user_id,title,content,create_time,status,is_read,read_time')
->page($offset)
->limit($limit)
->select();
return $list;
}
/**
* @ 店铺类型说明
*
* return string
*/
public function GetDescription(){}
/**
* @ 店铺保证金
*
* return list
*/
public function Getdeposit(){}
}

View File

@ -0,0 +1,22 @@
<?php
declare (strict_types = 1);
namespace app\admin\model\merchant;
use think\Model;
/**
* @mixin \think\Model
*/
class MerchantApplyments extends Model
{
protected $table = "eb_merchant_intention";
function __construct(){}
function GetList(){
$list = self::where()->select();
return $list;
}
}

View File

@ -0,0 +1,53 @@
<?php
/**
* 商户菜单 model
*
* @author刘孝全
* @emailq8197264@126.com
* @date 2023年03月3日
*/
declare (strict_types = 1);
namespace app\admin\model\system\auth;
use think\Model;
/**
* Class Menu
*/
class Menu extends Model
{
// 指定连接到商城库
protected $connection = 'shop';
// 指定此model关联表
protected $table = 'eb_system_menu';
/**
* 按条件获取商户菜单数据
*
* @param array $where 过滤字段条件
* @param int $is_mer 菜单类型: 0商城平台菜单 1商户菜单
*
* @return array
*/
function Search(array $where=[], int $is_mer=2):array
{
// 按条件 拼接 select 前sql
$query = self::where('is_mer', $is_mer)->order('sort DESC,menu_id ASC');
if (isset($where['pid'])) $query->where('pid', (int)$where['pid']);
if (isset($where['keyword'])) $query->whereLike('menu_name|route', "%{$where['keyword']}%");
if (isset($where['is_menu'])) $query->where('is_menu', (int)$where['is_menu']);
// 查询记录总行数
// $count = $query->count();
// 隐藏指定字段
$list = $query->hidden(['update_time', 'path'])->select()->toArray();
// 合并为一个数组并返回
// compact('count', 'list');
return $list;
}
}

View File

@ -0,0 +1,14 @@
<?php
declare (strict_types = 1);
namespace app\admin\model\system\auth;
use think\Model;
/**
* @mixin \think\Model
*/
class Role extends Model
{
//
}

View File

@ -0,0 +1,14 @@
<?php
declare (strict_types = 1);
namespace app\admin\model\system\merchant;
use think\Model;
/**
* @mixin \think\Model
*/
class MerchantType extends Model
{
//
}

16
app/admin/route/app.php Normal file
View File

@ -0,0 +1,16 @@
<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
Route::get('home', function () {
return 'hello,ThinkPHP6!';
});

87
app/admin/route/menu.php Normal file
View File

@ -0,0 +1,87 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
use think\facade\Route;
use app\common\middleware\AdminAuthMiddleware;
use app\common\middleware\AdminTokenMiddleware;
use app\common\middleware\AllowOriginMiddleware;
use app\common\middleware\LogMiddleware;
Route::group(function () {
//权限管理
// Route::group('system/menu', function () {
// Route::get('lst', '/getList')->name('systemMenuGetLst')->option([
// '_alias' => '平台菜单/权限列表',
// ]);
// Route::get('create/form', '/createForm')->name('systemMenuCreateForm')->option([
// '_alias' => '平台菜单/权限添加表单',
// '_auth' => false,
// '_form' => 'systemMenuCreate',
// ]);
// Route::get('update/form/:id', '/updateForm')->name('systemMenuUpdateForm')->option([
// '_alias' => '平台菜单/权限编辑表单',
// '_auth' => false,
// '_form' => 'systemMenuUpdate',
// ]);
// Route::post('create', '/create')->name('systemMenuCreate')->option([
// '_alias' => '平台菜单/权限添加',
// ]);
// Route::post('update/:id', '/update')->name('systemMenuUpdate')->option([
// '_alias' => '平台菜单/权限编辑',
// ]);
// Route::delete('delete/:id', '/delete')->name('systemMenuDelete')->option([
// '_alias' => '平台菜单/权限删除',
// ]);
// })->prefix('admin.system.auth.Menu')->option([
// '_path' => '/setting/menu',
// '_auth' => true,
// ]);
//商户权限管理
Route::group('merchant/menu', function () {
Route::get('index', '/index')->name('systemMerchantMenuIndex')->option([
'_alias' => '商户菜单/权限表单',
'_auth' => false,
'_form' => 'systemMerchantMenuIndex',
]);
Route::get('lst', '/lst')->name('systemMerchantMenuGetLst')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限列表',
]);
Route::get('create/form', '/createForm')->name('systemMerchantMenuCreateForm')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限添加表单',
'_auth' => false,
'_form' => 'systemMerchantMenuCreate',
]);
Route::get('update/form/:id', '/updateForm')->name('systemMerchantMenuUpdateForm')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限编辑表单',
'_auth' => false,
'_form' => 'systemMerchantMenuUpdate',
]);
Route::post('create', '/create')->name('systemMerchantMenuCreate')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限添加',
]);
Route::post('update/:id', '/update')->name('systemMerchantMenuUpdate')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限编辑',
]);
Route::delete('delete/:id', '/delete')->name('systemMerchantMenuDelete')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限删除',
]);
})->prefix('merchant.system.merchant.auth.Menu')->option([
'_path' => '/merchant/menu',
'_auth' => true,
]);
});
// ->middleware(AllowOriginMiddleware::class)
// ->middleware(AdminTokenMiddleware::class, true)
// ->middleware(AdminAuthMiddleware::class)
// ->middleware(LogMiddleware::class);

View File

@ -0,0 +1,142 @@
<?php
use think\facade\Route;
/**
* 路由访问示例: http://nk1.lihaink.cn/admin/merchant/type/lst
* 物理地址: http://nk1.lihaink.cn/admin/merchant.system.merchant.MerchantType/index
*/
Route::group(function(){
// 商户分类
Route::group('/merchant/classify', function(){
Route::get('lst', '/lst')->name('systemMerchantCategoryLst')->option([
'_alias' => '商户分类列表',
]);
// Route::get('category_lst', '/lst')->option([
// '_alias' => '商户分类列表',
// '_auth' => false,
// ]);
Route::post('add', '/create')->name('systemMerchantCategoryCreate')->option([
'_alias' => '商户分类添加',
]);
Route::get('form', '/createForm')->name('systemMerchantCategoryCreateForm')->option([
'_alias' => '商户分类添加表单',
'_auth' => false,
'_form' => 'systemMerchantCategoryCreate',
]);
Route::delete('del/:id', '/delete')->name('systemMerchantCategoryDelete')->option([
'_alias' => '商户分类删除',
]);
Route::post('edit/:id', '/update')->name('systemMerchantCategoryUpdate')->option([
'_alias' => '商户分类编辑',
]);
Route::get('edit/form/:id', '/updateForm')->name('systemMerchantCategoryUpdateForm')->option([
'_alias' => '商户分类编辑表单',
'_auth' => false,
'_form' => 'systemMerchantCategoryUpdate',
]);
Route::get('options', '/getOptions')->option([
'_alias' => '商户分类筛选',
'_auth' => false,
]);
})->prefix('merchant.system.merchant.MerchantCategory')->option([
'_path' => '/merchant/classify',
'_auth' => true,
]);
// 店铺类型
Route::group('/merchant/type',function(){
Route::get('lst', '/lst')->name('systemMerchantTypeLst')->option([
'_alias' => '列表',
]);
Route::get('detail/:id', '/detail')->name('systemMerchantTypeDetail')->option([
'_alias' => '详情',
]);
Route::post('add', '/add')->name('systemMerchantTypeAdd')->option([
'_alias' => '添加',
]);
Route::put('edit/:id', '/edit')->name('systemMerchantTypeUpdate')->option([
'_alias' => '编辑',
]);
Route::delete('del/:id', '/del')->name('systemMerchantTypeDelete')->option([
'_alias' => '删除',
]);
Route::get('mark/:id', '/markForm')->name('systemMerchantTypeMarkForm')->option([
'_alias' => '备注',
'_auth' => false,
'_form' => 'systemMerchantTypeMark',
]);
Route::post('mark/:id', '/mark')->name('systemMerchantTypeMark')->option([
'_alias' => '备注',
]);
Route::get('description', '/description')->name('systemMerchantTypeDescrForm')->option([
'_alias' => '店铺类型说明',
]);
Route::post('description', '/description')->name('systemMerchantTypeDescr')->option([
'_alias' => '店铺类型说明',
]);
})->prefix('merchant.system.merchant.MerchantType')->option([
'_path' => '/merchant/type',
'_auth' => true,
]);
//店铺保证金
Route::group('/margin', function(){
//缴纳记录
Route::get('lst', '/lst')->name('systemMerchantMarginLst')->option([
'_alias' => '缴纳记录',
]);
//扣费记录
Route::get('list/:id', '/getMarginLst')->name('systemMarginList')->option([
'_alias' => '扣费记录',
]);
//扣除保证金
Route::get('set/:id/form', '/setMarginForm')->name('systemMarginSetForm')->option([
'_alias' => '扣除保证金表单',
'_auth' => false,
'_form' => 'systemMarginSet',
]);
Route::post('set', '/setMargin')->name('systemMarginSet')->option([
'_alias' => '扣除保证金',
]);
})->prefix('merchant.system.merchant.MerchantMargin')->option([
'_path' => '/margin',
'_auth' => true,
]);
// 保证金退还
Route::group('margin/refund', function(){
//退款申请
Route::get('refund/lst', 'financial.Financial/getMarginLst')->name('systemMarginRefundList')->option([
'_alias' => '退款申请列表',
]);
Route::get('refund/show/:id', 'financial.Financial/refundShow')->name('systemMarginRefundShow')->option([
'_alias' => '退款申请详情',
]);
// //审核
Route::get('refund/status/:id/form', 'financial.Financial/statusForm')->name('systemMarginRefundSwitchStatusForm')->option([
'_alias' => '审核表单',
'_auth' => false,
'_form' => 'systemMarginRefundSwitchStatus',
]);
Route::post('refund/status/:id', 'financial.Financial/switchStatus')->name('systemMarginRefundSwitchStatus')->append(['type' => 1])->option([
'_alias' => '审核',
]);
// //备注
Route::get('refund/mark/:id/form', 'financial.Financial/markMarginForm')->name('systemMarginRefundMarkForm')->option([
'_alias' => '备注表单',
'_auth' => false,
'_form' => 'systemMarginRefundMark',
]);
Route::post('refund/mark/:id', 'financial.Financial/mark')->name('systemMarginRefundMark')->option([
'_alias' => '备注',
]);
});
});

View File

@ -0,0 +1,82 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
use think\facade\Route;
use app\common\middleware\AdminAuthMiddleware;
use app\common\middleware\AdminTokenMiddleware;
use app\common\middleware\AllowOriginMiddleware;
use app\common\middleware\LogMiddleware;
Route::group(function () {
//权限管理
// Route::group('system/menu', function () {
// Route::get('lst', '/getList')->name('systemMenuGetLst')->option([
// '_alias' => '平台菜单/权限列表',
// ]);
// Route::get('create/form', '/createForm')->name('systemMenuCreateForm')->option([
// '_alias' => '平台菜单/权限添加表单',
// '_auth' => false,
// '_form' => 'systemMenuCreate',
// ]);
// Route::get('update/form/:id', '/updateForm')->name('systemMenuUpdateForm')->option([
// '_alias' => '平台菜单/权限编辑表单',
// '_auth' => false,
// '_form' => 'systemMenuUpdate',
// ]);
// Route::post('create', '/create')->name('systemMenuCreate')->option([
// '_alias' => '平台菜单/权限添加',
// ]);
// Route::post('update/:id', '/update')->name('systemMenuUpdate')->option([
// '_alias' => '平台菜单/权限编辑',
// ]);
// Route::delete('delete/:id', '/delete')->name('systemMenuDelete')->option([
// '_alias' => '平台菜单/权限删除',
// ]);
// })->prefix('admin.system.auth.Menu')->option([
// '_path' => '/setting/menu',
// '_auth' => true,
// ]);
//商户权限管理
Route::group('merchant/menu', function () {
Route::get('lst', '/getList')->name('systemMerchantMenuGetLst')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限列表',
]);
Route::get('create/form', '/createForm')->name('systemMerchantMenuCreateForm')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限添加表单',
'_auth' => false,
'_form' => 'systemMerchantMenuCreate',
]);
Route::get('update/form/:id', '/updateForm')->name('systemMerchantMenuUpdateForm')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限编辑表单',
'_auth' => false,
'_form' => 'systemMerchantMenuUpdate',
]);
Route::post('create', '/create')->name('systemMerchantMenuCreate')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限添加',
]);
Route::post('update/:id', '/update')->name('systemMerchantMenuUpdate')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限编辑',
]);
Route::delete('delete/:id', '/delete')->name('systemMerchantMenuDelete')->append(['merchant' => 1])->option([
'_alias' => '商户菜单/权限删除',
]);
})->prefix('admin.system.auth.Menu')->option([
'_path' => '/merchant/system',
'_auth' => true,
]);
});
// ->middleware(AllowOriginMiddleware::class)
// ->middleware(AdminTokenMiddleware::class, true)
// ->middleware(AdminAuthMiddleware::class)
// ->middleware(LogMiddleware::class);

View File

@ -0,0 +1,246 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
use think\facade\Route;
Route::group(function () {
//商户分类
Route::group('system/merchant', function () {
Route::get('category/lst', '/lst')->name('systemMerchantCategoryLst')->option([
'_alias' => '商户分类列表',
]);
Route::get('category_lst', '/lst')->option([
'_alias' => '商户分类列表',
'_auth' => false,
]);
Route::post('category', '/create')->name('systemMerchantCategoryCreate')->option([
'_alias' => '商户分类添加',
]);
Route::get('category/form', '/createForm')->name('systemMerchantCategoryCreateForm')->option([
'_alias' => '商户分类添加表单',
'_auth' => false,
'_form' => 'systemMerchantCategoryCreate',
]);
Route::delete('category/:id', '/delete')->name('systemMerchantCategoryDelete')->option([
'_alias' => '商户分类删除',
]);
Route::post('category/:id', '/update')->name('systemMerchantCategoryUpdate')->option([
'_alias' => '商户分类编辑',
]);
Route::get('category/form/:id', '/updateForm')->name('systemMerchantCategoryUpdateForm')->option([
'_alias' => '商户分类编辑表单',
'_auth' => false,
'_form' => 'systemMerchantCategoryUpdate',
]);
Route::get('category/options', '/getOptions')->option([
'_alias' => '商户分类筛选',
'_auth' => false,
]);
})->prefix('admin.system.merchant.MerchantCategory')->option([
'_path' => '/merchant/classify',
'_auth' => true,
]);
//申请列表
Route::group('merchant/intention', function () {
Route::get('lst', '/lst')->name('systemMerchantIntentionLst')->option([
'_alias' => '列表',
]);
Route::post('status/:id', '/switchStatus')->name('systemMerchantIntentionStatus')->option([
'_alias' => '审核',
]);
Route::delete('delete/:id', '/delete')->name('systemMerchantIntentionDelete')->option([
'_alias' => '删除',
]);
Route::get('mark/:id/form', '/form')->name('systemMerchantIntentionMarkForm')->option([
'_alias' => '备注',
'_auth' => false,
'_form' => 'systemMerchantIntentionMark',
]);
Route::get('status/:id/form', '/statusForm')->name('systemMerchantIntentionStatusForm')->option([
'_alias' => '申请商户',
'_auth' => false,
'_form' => 'systemMerchantIntentionStatus',
]);
Route::post('mark/:id', '/mark')->name('systemMerchantIntentionMark')->option([
'_alias' => '备注',
]);
Route::get('excel', '/excel');
})->prefix('admin.system.merchant.MerchantIntention')->option([
'_path' => '/merchant/application',
'_auth' => true,
]);
//商户管理
Route::group('system/merchant', function () {
Route::get('create/form', '.Merchant/createForm')->name('systemMerchantCreateForm')->option([
'_alias' => '商户列表',
]);
Route::get('count', '.Merchant/count')->name('systemMerchantCount')->option([
'_alias' => '商户列表统计',
]);
Route::get('lst', '.Merchant/lst')->name('systemMerchantLst')->option([
'_alias' => '商户列表',
]);
Route::post('create', '.Merchant/create')->name('systemMerchantCreate')->option([
'_alias' => '商户添加',
]);
Route::get('update/form/:id', '.Merchant/updateForm')->name('systemMerchantUpdateForm')->option([
'_alias' => '商户编辑表单',
'_auth' => false,
'_form' => 'systemMerchantUpdate',
]);
Route::post('update/:id', '.Merchant/update')->name('systemMerchantUpdate')->option([
'_alias' => '商户编辑',
]);
Route::post('status/:id', '.Merchant/switchStatus')->name('systemMerchantStatus')->option([
'_alias' => '商户修改推荐',
]);
Route::post('close/:id', '.Merchant/switchClose')->name('systemMerchantClose')->option([
'_alias' => '商户开启/关闭',
]);
Route::delete('delete/:id', '.Merchant/delete')->name('systemMerchantDelete')->option([
'_alias' => '商户删除',
]);
Route::post('password/:id', '.MerchantAdmin/password')->name('systemMerchantAdminPassword')->option([
'_alias' => '商户修改密码',
]);
Route::get('password/form/:id', '.MerchantAdmin/passwordForm')->name('systemMerchantAdminPasswordForm')->option([
'_alias' => '商户修改密码表单',
'_auth' => false,
'_form' => 'systemMerchantAdminPassword',
]);
Route::post('login/:id', '.Merchant/login')->name('systemMerchantLogin')->option([
'_alias' => '商户登录',
]);
Route::get('changecopy/:id/form', '.Merchant/changeCopyNumForm')->name('systemMerchantChangeCopyForm')->option([
'_alias' => '修改采集商品次数表单',
'_auth' => false,
'_form' => 'systemMerchantChangeCopy',
]);
Route::post('changecopy/:id', '.Merchant/changeCopyNum')->name('systemMerchantChangeCopy')->option([
'_alias' => '修改采集商品次数',
]);
})->prefix('admin.system.merchant')->option([
'_path' => '/merchant/list',
'_auth' => true,
'_append'=> [
[
'_name' =>'uploadImage',
'_path' =>'/merchant/list',
'_alias' => '上传图片',
'_auth' => true,
],
[
'_name' =>'systemAttachmentLst',
'_path' =>'/merchant/list',
'_alias' => '图片列表',
'_auth' => true,
],
]
]);
// 店铺类型
Route::group('merchant/type', function () {
Route::get('lst', '/lst')->name('systemMerchantTypeLst')->option([
'_alias' => '列表',
]);
Route::post('create', '/create')->name('systemMerchantTypeCreate')->option([
'_alias' => '添加',
]);
Route::post('update/:id', '/update')->name('systemMerchantTypeUpdate')->option([
'_alias' => '编辑',
]);
Route::delete('delete/:id', '/delete')->name('systemMerchantTypeDelete')->option([
'_alias' => '删除',
]);
Route::get('mark/:id', '/markForm')->name('systemMerchantTypeMarkForm')->option([
'_alias' => '备注',
'_auth' => false,
'_form' => 'systemMerchantTypeMark',
]);
Route::post('mark/:id', '/mark')->name('systemMerchantTypeMark')->option([
'_alias' => '备注',
]);
Route::get('detail/:id', '/detail')->name('systemMerchantTypeDetail')->option([
'_alias' => '备注',
]);
Route::get('options', '/options')->option([
'_alias' => '筛选',
'_auth' => false,
]);
Route::get('mer_auth', '/mer_auth')->option([
'_alias' => '权限',
'_auth' => false,
]);
})->prefix('admin.system.merchant.MerchantType')->option([
'_path' => '/merchant/type',
'_auth' => true,
]);
//保证金
Route::group('margin', function () {
//缴纳记录
Route::get('lst', 'merchant.MerchantMargin/lst')->name('systemMerchantMarginLst')->option([
'_alias' => '缴纳记录',
]);
//扣费记录
Route::get('list/:id', 'merchant.MerchantMargin/getMarginLst')->name('systemMarginList')->option([
'_alias' => '扣费记录',
]);
//扣除保证金
Route::get('set/:id/form', 'merchant.MerchantMargin/setMarginForm')->name('systemMarginSetForm')->option([
'_alias' => '扣除保证金表单',
'_auth' => false,
'_form' => 'systemMarginSet',
]);
Route::post('set', 'merchant.MerchantMargin/setMargin')->name('systemMarginSet')->option([
'_alias' => '扣除保证金',
]);
//退款申请
Route::get('refund/lst', 'financial.Financial/getMarginLst')->name('systemMarginRefundList')->option([
'_alias' => '退款申请列表',
]);
Route::get('refund/show/:id', 'financial.Financial/refundShow')->name('systemMarginRefundShow')->option([
'_alias' => '退款申请详情',
]);
//审核
Route::get('refund/status/:id/form', 'financial.Financial/statusForm')->name('systemMarginRefundSwitchStatusForm')->option([
'_alias' => '审核表单',
'_auth' => false,
'_form' => 'systemMarginRefundSwitchStatus',
]);
Route::post('refund/status/:id', 'financial.Financial/switchStatus')->name('systemMarginRefundSwitchStatus')->append(['type' => 1])->option([
'_alias' => '审核',
]);
//备注
Route::get('refund/mark/:id/form', 'financial.Financial/markMarginForm')->name('systemMarginRefundMarkForm')->option([
'_alias' => '备注表单',
'_auth' => false,
'_form' => 'systemMarginRefundMark',
]);
Route::post('refund/mark/:id', 'financial.Financial/mark')->name('systemMarginRefundMark')->option([
'_alias' => '备注',
]);
})->prefix('admin.system.')->option([
'_path' => '/merchant/deposit_list',
'_auth' => true,
]);
});

View File

@ -0,0 +1,26 @@
<?php
use think\facade\Route;
//协议
Route::group('agreement', function () {
Route::get('keylst', '/getKeyLst')->name('systemAgreeKeyLsy')->option([
'_alias' => '协议列表',
]);
Route::get(':key', '/getAgree')->name('systemAgreeDetail')->option([
'_alias'=> '协议',
'_auth' => false,
'_form' => 'systemAgreeSave',
]);
Route::post(':key', '/saveAgree')->name('systemAgreeSave')->option([
'_alias' => '协议保存',
'_init' => [ \crmeb\services\UpdateAuthInit::class,'agreement'],
]);
})->prefix('admin.system.Cache')->option([
'_path' => '/setting/agreements',
'_auth' => true,
]);

View File

@ -0,0 +1,150 @@
{extend name="common/base" /}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
<h3 class="pb-3">功能菜单/节点</h3>
{if condition="$id eq 0"}
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray-2">父级菜单/节点<font>*</font>
</td>
<td>
<select name="pid" lay-verify="required" lay-reqText="请选择父级菜单/节点">
<option value="0">作为顶级菜单/节点</option>
{volist name=":set_recursion(get_admin_rule())" id="v"}
<option value="{$v.id}" {eq name="pid" value="$v.id" }selected="" {/eq}>{$v.title} </option>
{/volist}
</select>
</td>
<td class="layui-td-gray-2">左侧菜单显示<font>*</font>
</td>
<td>
<input type="radio" name="menu" value="1" title="是">
<input type="radio" name="menu" value="2" title="不是">
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单/节点名称<font>*</font>
</td>
<td>
<input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入菜单/节点名称"
lay-reqText="请输入菜单/节点名称" class="layui-input">
</td>
<td class="layui-td-gray">操作日志名称<font>*</font>
</td>
<td>
<input type="text" name="name" lay-verify="required" placeholder="请输入操作日志名称" lay-reqText="请输入操作日志名称"
autocomplete="off" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单/节点URL</td>
<td>
<input type="text" name="src" placeholder="请输入菜单/节点URL可空" autocomplete="off" class="layui-input">
</td>
<td class="layui-td-gray">菜单排序</td>
<td>
<input type="text" name="sort" value="0" placeholder="请输入数字,越小越靠前" autocomplete="off"
class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单图标</td>
<td colspan="3">
<input type="text" name="icon" style="width:150px; display:inline" placeholder="请输入图标,可空"
autocomplete="off" class="layui-input">
bi-gear<a href="{__GOUGU__}/icon/index.html" target="_blank" style="margin-left:10px; color:#007AFF">[查看图标]</a>
</td>
</tr>
</table>
{else/}
<table class="layui-table layui-table-form">
<tr>
<td class="layui-td-gray-2">父级菜单/节点<font>*</font>
</td>
<td>
<select name="pid" lay-verify="required" lay-reqText="请选择父级菜单/节点">
<option value="0">作为顶级节点</option>
{volist name=":set_recursion(get_admin_rule())" id="v"}
<option value="{$v.id}" {eq name="$detail.pid" value="$v.id" }selected="" {/eq}>{$v.title} </option>
{/volist}
</select>
</td>
<td class="layui-td-gray-2">左侧菜单显示<font>*</font>
</td>
<td>
<input type="radio" name="menu" value="1" title="是" {eq name="$detail.menu" value="1" } checked{/eq}>
<input type="radio" name="menu" value="2" title="不是" {eq name="$detail.menu" value="2" } checked{/eq}>
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单/节点名称<font>*</font>
</td>
<td>
<input type="text" name="title" value="{$detail.title}" lay-verify="required" autocomplete="off"
placeholder="请输入菜单/节点名称" lay-reqText="请输入菜单/节点名称" class="layui-input">
</td>
<td class="layui-td-gray">操作日志名称<font>*</font>
</td>
<td>
<input type="text" name="name" value="{$detail.name}" lay-verify="required" placeholder="请输入操作日志名称"
lay-reqText="请输入操作日志名称" autocomplete="off" class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单/节点URL</td>
<td>
<input type="text" name="src" value="{$detail.src}" placeholder="请输入菜单/节点URL可空" autocomplete="off"
class="layui-input">
</td>
<td class="layui-td-gray">菜单排序</td>
<td>
<input type="text" name="sort" value="{$detail.sort}" placeholder="请输入数字,越小越靠前" autocomplete="off"
class="layui-input">
</td>
</tr>
<tr>
<td class="layui-td-gray">菜单图标</td>
<td colspan="3">
<input style="width:150px; display:inline" type="text" name="icon" value="{$detail.icon}" placeholder="请输入图标,可空" autocomplete="off" class="layui-input">
<i class="bi {$detail.icon}"></i><a href="{__GOUGU__}/icon/index.html" target="_blank" style="margin-left:10px; color:#007AFF">[查看图标]</a>
</td>
</tr>
</table>
{/if}
<div style="padding: 10px 0">
<input type="hidden" name="id" value="{$id}">
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var form = layui.form,tool=layui.tool;
//监听提交
form.on('submit(webform)', function (data) {
if (!data.field.menu || data.field.menu == '') {
layer.msg('请选择是否在左侧菜单显示');
return false;
}
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
setTimeout(function () {
parent.location.reload();
}, 1000);
}
}
tool.post("/admin/rule/add", data.field, callback);
return false;
});
}
</script>
{/block}
<!-- /脚本 -->

View File

@ -0,0 +1,40 @@
<?php
/**
* 格式化数据结构类
*
* @author刘孝全
* @emailq8197264@126.com
* @date 2023年03月2日
*/
namespace app\common\controller;
class FormatList
{
/**
* 无线级分类处理
*
* @param array $data 数据源
* @param string $idName 主键
* @param string $fieldName 父级字段
* @param string $childrenKey 子级字段名
* @return array
*
* @date 2020-03-27
*/
function FormatCategory(array $data, string $idName = "id", string $fieldName = 'pid', $childrenKey = 'children')
{
$items = [];
foreach ($data as $item) {
$items[$item[$idName]] = $item;
}
$result = array();
foreach ($items as $item) {
if (isset($items[$item[$fieldName]])) {
$items[$item[$fieldName]][$childrenKey][] = &$items[$item[$idName]];
} else if ($item[$fieldName] == 0) {
$result[] = &$items[$item[$idName]];
}
}
return $result;
}
}

View File

@ -0,0 +1,294 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\validate\merchant;
use think\Validate;
class MerchantApplymentsValidate extends Validate
{
protected $failException = true;
//2401小微商户指无营业执照的个人商家。
//2500个人卖家指无营业执照已持续从事电子商务经营活动满6个月且期间经营收入累计超过20万元的个人商家。若选择该主体请在“补充说明”填写相关描述
//4个体工商户营业执照上的主体类型一般为个体户、个体工商户、个体经营。
//2企业营业执照上的主体类型一般为有限公司、有限责任公司。
//3党政、机关及事业单位包括国内各级、各类政府机构、事业单位等公安、党 团、司法、交通、旅游、工商税务、市政、医疗、教育、学校等机构)。
//1708其他组织不属于企业、政府/事业单位的组织机构(如社会团体、民办非企业、基 金会),要求机构已办理组织机构代码证。
protected $rule = [
'organization_type|主体类型' => 'require|in:2,3,4,2401,2500,1708',
'business_license_info|营业执照/登记证书信息' => 'checkBusinessInfo',
// 'organization_cert_info|组织机构代码证信息' => 'checkOrganization',
'id_doc_type|证件类型' => 'require|in:1,2,3,4,5,6,7,8',
'id_card_info|经营者/法人身份证信息' => 'checkIdCardInfo',
'id_doc_info|经营者/法人身份证信息' => 'checkIdDocInfo',
// 'need_account_info|是否填写结算银行账户' => 'require|in:true,false', 废弃字段
'account_info|结算银行账户' => 'getAccountInfo',
'contact_info|超级管理员信息' => 'getContactInfo',
'sales_scene_info|店铺信息'=>'checkSalesSceneInfo',
'merchant_shortname|商户简称' => 'require',
'business_addition_desc' => 'checkBusinessAdditionDesc',
];
/**
* TODO 营业执照/登记证书信息
* @param $item
* @param $rule
* @param $data
* @return bool|string
* @author Qinii
* @day 6/22/21
*/
protected function checkBusinessInfo($item,$rule,$data)
{
if(!in_array($data['organization_type'],['2401','2500'])){
if(empty($item)) return '营业执照/登记证书信息为空';
if(!isset($item['business_license_copy']) || empty($item['business_license_copy'])) return '证件扫描件为空';
if(!isset($item['business_license_number']) || empty($item['business_license_number'])) return '证件注册号为空';
if(!isset($item['merchant_name']) || empty($item['merchant_name'])) return '商户名称为空';
if(!isset($item['legal_person']) || empty($item['legal_person'])) return '经营者/法定代表人姓名为空';
if(isset($item['business_time'])) {
$statr = $item['business_time'][0];
$end = $item['business_time'][1];
if ($end !== '长期') {
$statr = strtotime($statr);
$end = strtotime($end);
$t = $end - $statr;
if (($t / (3600 * 24)) <= 60) return '营业执照/登记证书有效期必须大于60天即结束时间距当前时间需超过60天';
}
}
}
return true;
}
/**
* TODO 组织机构代码证信息
* @param $item
* @param $rule
* @param $data
* @return bool|string
* @author Qinii
* @day 6/22/21
*/
protected function checkOrganization($item,$rule,$data)
{
$len = strlen($data['business_license_info']['business_license_number']);
if(!in_array($data['organization_type'],['4','2401','2500']) && $len === 18){
if(empty($item)) return '组织机构代码证信息为空';
if(!isset($item['organization_copy']) || empty($item['organization_copy'])) return '组织机构代码证照片为空';
if(!isset($item['organization_number']) || empty($item['organization_number'])) return '组织机构代码为空';
if(!isset($item['organization_time']) || empty($item['organization_time'])) return '组织机构代码有效期限为空';
// list($statr,$end) = explode(',',$item['organization_time']);
$statr = $item['organization_time'][0];
$end = $item['organization_time'][1];
if($end !== '长期') {
$statr = strtotime($statr);
$end = strtotime($end);
$t = $end - $statr;
if(($t/(3600 * 24)) <= 60) return '组织机构代码证有效期必须大于60天即结束时间距当前时间需超过60天';
}
}
return true;
}
/**
* TODO 经营者/法人身份证信息/身份证
* @param $item
* @param $rule
* @param $data
* @return bool|string
* @author Qinii
* @day 6/22/21
*/
protected function checkIdCardInfo($item,$rule,$data)
{
if($data['id_doc_type'] == 1){
if(empty($item)) return '经营者/法人身份证信息为空';
if(!isset($item['id_card_copy']) || empty($item['id_card_copy'])) return '身份证人像面照片为空';
if(!isset($item['id_card_national']) || empty($item['id_card_national'])) return '身份证国徽面照片为空';
if(!isset($item['id_card_name']) || empty($item['id_card_name'])) return '身份证姓名为空';
if(!isset($item['id_card_number']) || empty($item['id_card_number'])) return '身份证号码为空';
if(!isset($item['id_card_valid_time_begin']) || empty($item['id_card_valid_time_begin'])) return '经营者/法人身份证信息身份证开始时间为空';
if(!isset($item['id_card_valid_time']) || empty($item['id_card_valid_time'])) return '经营者/法人身份证信息身份证有效期限为空';
if($item['id_card_valid_time'] !== '长期') {
$statr = time();
$end = strtotime($item['id_card_valid_time']);
$t = $end - $statr;
if(($t/(3600 * 24)) <= 60) return '经营者/法人身份证信息证件结束日期必须大于60天即结束时间距当前时间需超过60天';
if(strtotime($item['id_card_valid_time_begin']) >= strtotime($item['id_card_valid_time'])) return '经营者/法人身份证信息证件结束日期必须大于证件开始时间';
}
if($data['organization_type'] === 2){
if(!isset($item['id_card_address']) || empty($item['id_card_address'])) return '经营者/法人身份证信息身份证居住地址为空';
}
};
return true;
}
/**
* TODO 经营者/法人身份证信息/通行证
* @param $item
* @param $rule
* @param $data
* @return bool|string
* @author Qinii
* @day 6/22/21
*/
protected function checkIdDocInfo($item,$rule,$data)
{
if(in_array($data['organization_type'],['2401','2500']) && !empty($item)) return '小微/个人卖家可选证件类型:身份证';
if($data['id_doc_type'] !== 1){
if(empty($item)) return '经营者/法人身份证信息为空';
if(!isset($item['id_doc_name']) || empty($item['id_doc_name'])) return '证件姓名为空';
if(!isset($item['id_doc_number']) || empty($item['id_doc_number'])) return '证件号码为空';
if(!isset($item['id_doc_copy']) || empty($item['id_doc_copy'])) return '经营者/法人其他类型证件信息证件正面照片为空';
if($data['id_doc_type'] !== 2) //护照不需要传反面
{
if(!isset($item['id_doc_copy_back']) || empty($item['id_doc_copy_back'])) return '经营者/法人其他类型证件信息证件反面照片为空';
}
if(!isset($item['doc_period_begin']) || empty($item['doc_period_begin'])) return '经营者/法人其他类型证件信息证件有效期开始时间为空';
if(!isset($item['doc_period_end']) || empty($item['doc_period_end'])) return '经营者/法人其他类型证件信息证件结束日期为空';
if($item['doc_period_end'] !== '长期') {
$statr = time();
$end = strtotime($item['doc_period_end']);
$t = $end - $statr;
if(($t/(3600 * 24)) <= 60) return '经营者/法人其他类型证件信息证件结束日期必须大于60天即结束时间距当前时间需超过60天';
if(strtotime($item['doc_period_begin']) >= strtotime($item['doc_period_end'])) return '经营者/法人其他类型证件信息证件结束日期必须大于证件开始时间';
if($data['organization_type'] === 2){
if(!isset($item['id_doc_address']) || empty($item['id_doc_address'])) return '经营者/法人其他类型证件信息证件居住地址为空';
}
}
}
return true;
}
/**
* TODO 结算银行账户
* @param $item
* @param $rule
* @param $data
* @return bool|string
* @author Qinii
* @day 6/22/21
*/
protected function getAccountInfo($item,$rule,$data)
{
// if($data['need_account_info']){
if(empty($item)) return '结算银行账户信息为空';
if(!isset($item['bank_account_type']) || empty($item['bank_account_type'])) return '账户类型为空';
if(!isset($item['account_bank']) || empty($item['account_bank'])) return '开户银行为空';
if(!isset($item['account_name']) || empty($item['account_name'])) return '开户名称为空';
if(!isset($item['bank_address_code']) || empty($item['bank_address_code'])) return '开户银行省市编码为空';
if(!isset($item['account_number']) || empty($item['account_number'])) return '银行帐号为空';
// }
return true;
}
/**
* TODO 超级管理员信息
* @param $item
* @param $rule
* @param $data
* @return bool|string
* @author Qinii
* @day 6/22/21
*/
protected function getContactInfo($item,$rule,$data)
{
if(empty($item)) return '超级管理员信息信息为空';
if(!isset($item['contact_type']) || empty($item['contact_type'])) return '超级管理员类型为空';
if(!isset($item['contact_name']) || empty($item['contact_name'])) return '超级管理员姓名为空';
if(!isset($item['contact_id_card_number']) || empty($item['contact_id_card_number'])) return '超级管理员身份证件号码为空';
if(!isset($item['mobile_phone']) || empty($item['mobile_phone'])) return '超级管理员手机为空';
if(!in_array($data['organization_type'],['2401','2500'])){
if(!isset($item['contact_email']) || empty($item['contact_email'])) return '邮箱为空';
}
if($item['contact_type'] === 66) //当超级管理员类型为66经办人时
{
if(!isset($item['contact_id_doc_type']) || empty($item['contact_id_doc_type']) || !in_array($item['contact_id_doc_type'],[1,2,3,4,5,6,7,8])) return '超级管理员证件类型为空或不合法';
if(!isset($item['contact_id_doc_copy']) || empty($item['contact_id_doc_copy'])) return '超级管理员信息证件正面照片为空';
if($item['contact_id_doc_type'] !== 2) //护照不需要传反面
{
if(!isset($item['contact_id_doc_copy_back']) || empty($item['contact_id_doc_copy_back'])) return '超级管理员信息证件反面照片为空';
}
if(!isset($item['contact_id_doc_period_begin']) || empty($item['contact_id_doc_period_begin'])) return '超级管理员信息证件有效期开始时间为空';
if(!isset($item['contact_id_doc_period_end']) || empty($item['contact_id_doc_period_end'])) return '超级管理员信息证件结束日期为空';
if($item['contact_id_doc_period_end'] !== '长期') {
$statr = time();
$end = strtotime($item['contact_id_doc_period_end']);
$t = $end - $statr;
if(($t/(3600 * 24)) <= 60) return '超级管理员信息证件结束日期必须大于60天即结束时间距当前时间需超过60天';
if(strtotime($item['contact_id_doc_period_begin']) >= strtotime($item['contact_id_doc_period_end'])) return '超级管理员信息证件结束日期必须大于证件开始时间';
}
if(!isset($item['business_authorization_letter']) || empty($item['business_authorization_letter'])) return '超级管理员信息业务办理授权函为空';
}
return true;
}
/**
* TODO 店铺信息
* @param $item
* @param $rule
* @param $data
* @return bool|string
* @author Qinii
* @day 6/22/21
*/
protected function checkSalesSceneInfo($item,$rule,$data)
{
if(empty($item)) return '店铺信息为空';
if(!isset($item['store_name']) || empty($item['store_name'])) return '店铺名称为空';
if(!isset($item['store_url']) && !isset($item['store_url'])) return '店铺链接和店铺二维码二选一';
return true;
}
/**
* TODO 补充说明s
* @param $item
* @param $rule
* @param $data
* @return bool|string
* @author Qinii
* @day 6/24/21
*/
protected function checkBusinessAdditionDesc($item,$rule,$data)
{
if($data['organization_type'] == 2500 && empty($item)) return '若主体为“个人卖家”:补充说明不能为空';
return true;
}
}

View File

@ -14,4 +14,4 @@ Route::get('think', function () {
return 'hello,ThinkPHP6!';
});
Route::get('hello/:name', 'index/hello');
Route::get('hello/:name', 'index/hello');