企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
一、用户申请开店流程 个人、企业申请入驻:实名认证->Paycenter认证通过->申请入驻->平台审核通过 自营店铺:平台后台添加自营店铺 1.申请商家入驻 **实名认证:** 控制器:paycenter/controllers/InfoCtl.php -> certification(); 视图:paycenter/views/default/InfoCtl/certification.php ~~~ //认证表单提交 $('#form').validator({ ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { //验证 ...... }, fields : { 'user_realname':'required;', 'user_identity_card':'required;identity_type', 'user_identity_start_time':'required;', 'user_identity_end_time':'times;', }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form").serialize(), success:function(a){ if(a.status == 200) { Public.tips.success("<?=_('操作成功')?>"); var from = $('#page_from').val(); if(from == 'bt'){ location.href= "<?= Yf_Registry::get('url');?>?ctl=Info&met=btinfo"; }else{ location.href= "<?= Yf_Registry::get('url');?>?ctl=Info&met=account"; } } else { if(typeof(a.msg) != 'undefined'){ Public.tips.error(a.msg); }else{ Public.tips.error("<?=_('操作失败')?>"); } return false; } } }); } }); ~~~ 方法:editCertification() ~~~ $User_InfoModel = new User_InfoModel(); $flag = $User_InfoModel->editInfo($user_id,$edit); ~~~ **实名认证以后,需要在平台Paycenter后台认证审核:** 控制器:paycenter_admin/admin/controllers/paycen/PayInfoCtl.php 视图:paycenter_admin/admin/views/default/paycen/PayInfoCtl/index.php (1)个人申请商家入驻(URL参数:apply=1) 控制器:shop/controllers/Seller/Shop/SettledCtl.php -> index(); 模型:shop/models/Shop/BaseModel.php、shop/models/Shop/CompanyModel.php * 签订入驻协议:shop/views/default/Seller/Shop/SettledCtl/step1.php(视图) * 个人实名信息:shop/views/default/Seller/Shop/SettledCtl/step2.php(视图) ~~~ $('#form_company_info').validator({ //验证、ajax ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { tel:[/^[1][0-9]{10}$/,'<?=__('请输入正确的手机号码')?>'], zjtel:[/(^0\d{2,3}[-]?\d{5,9}$)|(^[1][0-9]{10}$)/,'<?=__('请输入正确的电话号码')?>'], daima:[/^[a-zA-Z0-9]{8}-[a-zA-Z0-9]$/,'<?=__('请输入正确的组织机构代码')?>'], times:function(element, params){ var start_time = $('#start_time').val(); var end_time = $('#end_time').val(); if(start_time>end_time && end_time){ return '<?=__('不能小于起始时间')?>'; } } }, fields: { //验证规则 }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form_company_info").serialize(), success:function(a){ if(a.status == 200) { location.href="./index.php?ctl=Seller_Shop_Settled&met=index&op=step3"; } else { if(typeof(a.msg) == 'undefined' || !a.msg){ Public.tips.error("<?=__('操作失败')?>"); }else{ Public.tips.error(a.msg); } return false; } } }); } }); }) $('#btn_apply_company_next').click(function() { $("#form_company_info").submit(); }); ~~~ 方法:addShopCompany() ~~~ if (!$shop_info){ $flag = $this->shopCompanyModel->addCompany($shop_company, TRUE); $shop_base['shop_id'] = $flag; $flag1 = $this->shopBaseModel->addBase($shop_base); if ($flag1 && $flag && $this->messageModel->sql->commitDb()) { $status = 200; $msg = __('success'); } else { $this->messageModel->sql->rollBackDb(); $status = 250; $msg = __('failure1'); } }else{ //编辑 $flag = $this->shopCompanyModel->editCompany($shop_info['shop_id'], $shop_company); $flag1 = $this->shopBaseModel->editBase($shop_info['shop_id'], $shop_base); $rs_rows = array(); check_rs($flag, $rs_rows); check_rs($flag1, $rs_rows); if (is_ok($rs_rows) && $this->messageModel->sql->commitDb()){ $status = 200; $msg = __('success'); }else{ $this->messageModel->sql->rollBackDb(); $status = 250; $msg = __('failure2'); } } ~~~ * 财务资质信息:shop/views/default/Seller/Shop/SettledCtl/step3.php(视图) ~~~ $('#form_company_info').validator({ ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { yh:[/^(\d{16}|\d{19})$/,"<?=__('请填写正确的银行账号')?>"], }, fields: { //验证规则 }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form_company_info").serialize(), success:function(a){ if(a.status == 200) { location.href="./index.php?ctl=Seller_Shop_Settled&met=index&op=step4&apply=<?=$apply?>"; } else { alert("<?=__('操作失败!')?>"); } } }); } }); $('#btn_apply_company_next').click(function() { $("#form_company_info").submit(); }); ~~~ 方法:editShopCompany() ~~~ $flag = $this->shopCompanyModel->editCompany($shop_id, $shop_company); $flag1 = $this->shopBaseModel->editBase($shop_id, array('shop_status'=>9)); ~~~ * 店铺经营信息:shop/views/default/Seller/Shop/SettledCtl/step4.php(视图) ~~~ $('#form_company_info').validator({ ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { }, fields: { 'shop_name': 'required;', 'shop_grade_id':'required;', 'joinin_year':'required;', 'shop_class_id':'required;', 'shop_class_bind_id':'required;', }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form_company_info").serialize(), success:function(a){ if(a.status == 200) { location.href="./index.php?ctl=Seller_Shop_Settled&met=index&op=step5&apply=<?=$apply?>"; } else { alert("<?=__('操作失败!')?>"); } } }); } }); $('#btn_apply_company_next').click(function() { $("#form_company_info").submit(); }); ~~~ 方法:editShopBase() ~~~ $shopClassBind = $this->shopClassBindModel->listByWhere(array('shop_id'=>$shop_id)); if($shopClassBind['items']){ $calss_id = array(); foreach ($shopClassBind['items'] as $val){ $calss_id[] = $val['shop_class_bind_id']; } $this->shopClassBindModel->removeClassBind($calss_id); } foreach ($product_class_id as $key => $value) { $shop_class['product_class_id'] = $value; $shop_class['commission_rate'] = $commission_rate[$key]; $shop_class['shop_class_bind_enable'] = 2; $shop_class['shop_id'] = $shop_id; $flag1 = $this->shopClassBindModel->addClassBind($shop_class); } ~~~ (2)企业申请商家入驻(URL参数:apply=2) 控制器:shop/controllers/Seller/Shop/SettledCtl.php -> index(); 模型:shop/models/Shop/BaseModel.php、shop/models/Shop/CompanyModel.php * 签订入驻协议:shop/views/default/Seller/Shop/SettledCtl/step1.php(视图) * 公司资质信息:shop/views/default/Seller/Shop/SettledCtl/step2.php(视图) ~~~ $('#form_company_info').validator({ //验证、ajax ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { tel:[/^[1][0-9]{10}$/,'<?=__('请输入正确的手机号码')?>'], zjtel:[/(^0\d{2,3}[-]?\d{5,9}$)|(^[1][0-9]{10}$)/,'<?=__('请输入正确的电话号码')?>'], daima:[/^[a-zA-Z0-9]{8}-[a-zA-Z0-9]$/,'<?=__('请输入正确的组织机构代码')?>'], times:function(element, params){ var start_time = $('#start_time').val(); var end_time = $('#end_time').val(); if(start_time>end_time && end_time){ return '<?=__('不能小于起始时间')?>'; } } }, fields: { //验证规则 }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form_company_info").serialize(), success:function(a){ if(a.status == 200) { location.href="./index.php?ctl=Seller_Shop_Settled&met=index&op=step3"; } else { if(typeof(a.msg) == 'undefined' || !a.msg){ Public.tips.error("<?=__('操作失败')?>"); }else{ Public.tips.error(a.msg); } return false; } } }); } }); }) $('#btn_apply_company_next').click(function() { $("#form_company_info").submit(); }); ~~~ 方法:addShopCompany() ~~~ if (!$shop_info){ $flag = $this->shopCompanyModel->addCompany($shop_company, TRUE); $shop_base['shop_id'] = $flag; $flag1 = $this->shopBaseModel->addBase($shop_base); if ($flag1 && $flag && $this->messageModel->sql->commitDb()) { $status = 200; $msg = __('success'); } else { $this->messageModel->sql->rollBackDb(); $status = 250; $msg = __('failure1'); } }else{ //编辑 $flag = $this->shopCompanyModel->editCompany($shop_info['shop_id'], $shop_company); $flag1 = $this->shopBaseModel->editBase($shop_info['shop_id'], $shop_base); $rs_rows = array(); check_rs($flag, $rs_rows); check_rs($flag1, $rs_rows); if (is_ok($rs_rows) && $this->messageModel->sql->commitDb()){ $status = 200; $msg = __('success'); }else{ $this->messageModel->sql->rollBackDb(); $status = 250; $msg = __('failure2'); } } ~~~ * 财务资质信息:shop/views/default/Seller/Shop/SettledCtl/step3.php(视图) ~~~ $('#form_company_info').validator({ ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { yh:[/^(\d{16}|\d{19})$/,"<?=__('请填写正确的银行账号')?>"], }, fields: { //验证规则 }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form_company_info").serialize(), success:function(a){ if(a.status == 200) { location.href="./index.php?ctl=Seller_Shop_Settled&met=index&op=step4&apply=<?=$apply?>"; } else { alert("<?=__('操作失败!')?>"); } } }); } }); $('#btn_apply_company_next').click(function() { $("#form_company_info").submit(); }); ~~~ 方法:editShopCompany() ~~~ $flag = $this->shopCompanyModel->editCompany($shop_id, $shop_company); $flag1 = $this->shopBaseModel->editBase($shop_id, array('shop_status'=>9)); ~~~ * 店铺经营信息:shop/views/default/Seller/Shop/SettledCtl/step4.php(视图) ~~~ $('#form_company_info').validator({ ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { }, fields: { 'shop_name': 'required;', 'shop_grade_id':'required;', 'joinin_year':'required;', 'shop_class_id':'required;', 'shop_class_bind_id':'required;', }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form_company_info").serialize(), success:function(a){ if(a.status == 200) { location.href="./index.php?ctl=Seller_Shop_Settled&met=index&op=step5&apply=<?=$apply?>"; } else { alert("<?=__('操作失败!')?>"); } } }); } }); $('#btn_apply_company_next').click(function() { $("#form_company_info").submit(); }); ~~~ 方法:editShopBase() ~~~ $shopClassBind = $this->shopClassBindModel->listByWhere(array('shop_id'=>$shop_id)); if($shopClassBind['items']){ $calss_id = array(); foreach ($shopClassBind['items'] as $val){ $calss_id[] = $val['shop_class_bind_id']; } $this->shopClassBindModel->removeClassBind($calss_id); } foreach ($product_class_id as $key => $value) { $shop_class['product_class_id'] = $value; $shop_class['commission_rate'] = $commission_rate[$key]; $shop_class['shop_class_bind_enable'] = 2; $shop_class['shop_id'] = $shop_id; $flag1 = $this->shopClassBindModel->addClassBind($shop_class); } ~~~ **提交申请,平台审核** 平台审核控制器:shop/controllers/Api/Shop/ManageCtl.php 平台审核视图:shop_admin/views/default/Shop/ManageCtl/getShoplist.php JS:shop_admin/static/default/js/controllers/shop/join/shop_join_list.js **签订合同** 控制器:shop/controllers/Seller/Shop/SettledCtl.php 签订合同及缴费:shop/views/default/Seller/Shop/SettledCtl/step5.php(视图) ~~~ $('#form').validator({ ignore: ':hidden', theme: 'yellow_right', timely: 1, stopOnError: false, rules: { }, fields: { 'payment_voucher': 'required;', 'payment_voucher_explain':'required;', }, valid:function(form){ //表单验证通过,提交表单 $.ajax({ url: ajax_url, data:$("#form").serialize(), success:function(a){ if(a.status == 200) { location.href="./index.php?ctl=Seller_Shop_Settled&met=index&op=step5&apply=<?=$apply?>"; } else { alert("<?=__('操作失败')?>"); } } }); } }); $('#btn_apply_company_next').click(function() { $("#form").submit(); }); ~~~ 方法:shopPaystatus() ~~~ //添加卖家 $check_seller = $SellerBaseModel->getByWhere(array('shop_id'=>$shop_id)); if(!$check_seller){ $seller_base['shop_id'] = $shop_id; $seller_base['user_id'] = Perm::$userId; $seller_base['seller_name'] = Perm::$row['user_account']; $seller_base['seller_is_admin'] = 1; $seller_add = $SellerBaseModel->addBase($seller_base); }else{ $seller_add = true; } ~~~ **申请店铺返回上一步** 方法:_getRpStep() ~~~ switch ($shop_step_info['rp']){ case 'step0': //1.没有入驻信息,2.支持所有的入驻 case 'step1': //没有入驻信息,仅支持单方面入驻,如果支持所有入驻,就退到step0 if($shop_step_info['shop_status'] == '-1'){ if(Web_ConfigModel::value('join_type') == 3){ $op = 'step0'; }else{ $op = 'step1'; } }else{ $status = false; } break; case 'step2': //1. 企业入驻 2. shop_status in 4,5,6,7,8,9 case 'pstep2': //1. 个人入驻 2. shop_status in 4,5,6,7,8,9 if(in_array($shop_step_info['shop_status'],array(4,5,6,7,8,9))){ if($shop_step_info['shop_business'] == 1){ $op = 'step2'; }else{ $op = 'pstep2'; } }else{ $status = false; } break; case 'step3': //1. 企业入驻 2. shop_status in 4,5,6,7,8,9 case 'pstep3': //1. 个人入驻 2. shop_status in 4,5,6,7,8,9 if(in_array($shop_step_info['shop_status'],array(4,5,6,7,8,9))){ if($shop_step_info['shop_business'] == 1){ $op = 'step3'; }else{ $op = 'pstep3'; } }else{ $status = false; } break; case 'step4': //1. shop_status in 4,5,6,7,8,9 if(in_array($shop_step_info['shop_status'],array(4,5,6,7,9))){ $op = 'step4'; }else{ $status = false; } break; case 'step5': //1. shop_status == 7 if($shop_step_info['shop_status'] == 7){ $op = 'step5'; }else{ $status = false; } break; default : $status = false; break; } ~~~ **平台审核店铺** 平台审核控制器:shop/controllers/Api/Shop/ManageCtl.php 平台审核视图:shop_admin/views/default/Shop/ManageCtl/pay.php JS:shop_admin/static/default/js/controllers/shop/join/shop_Pay_list.js 2.平台自营店铺 平台添加店铺: 控制器:shop/controllers/Api/Shop/SelfsupportCtl.php 视图:shop_admin/views/default/Shop/SelfsupportCtl/getShopAddRow.php 3.店铺状态 模型:shop/models/shop/BaseModel.php 参数:shop_status 0:关闭 1:待审核资料 2:待审核付款 3:开店成功 4:审核未通过 ~~~ public static $shop_status = array( "0" => "关闭", "1" => "待审核信息", "2" => "待审核付款", "3" => "开店成功", "4" => "审核未通过" ); ~~~