多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 店铺 一、用户申请开店流程 个人、企业申请入驻:实名认证->Paycenter认证通过->申请入驻->平台审核通过 自营店铺:平台后台添加自营店铺 1.申请商家入驻 **实名认证:** 控制器:paycenter/controllers/InfoCtl.php -> certification(); 视图:paycenter/views/default/InfoCtl/certification.php ``` <pre class="calibre14">``` <span class="token5">//认证表单提交</span> $<span class="token1">(</span><span class="token4">'#form'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span> ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span> theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span> timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span> rules<span class="token1">:</span> <span class="token1">{</span> <span class="token5">//验证</span> <span class="token1">.</span><span class="token1">.</span><span class="token1">.</span><span class="token1">.</span><span class="token1">.</span><span class="token1">.</span> <span class="token1">}</span><span class="token1">,</span> fields <span class="token1">:</span> <span class="token1">{</span> <span class="token4">'user_realname'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'user_identity_card'</span><span class="token1">:</span><span class="token4">'required;identity_type'</span><span class="token1">,</span> <span class="token4">'user_identity_start_time'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'user_identity_end_time'</span><span class="token1">:</span><span class="token4">'times;'</span><span class="token1">,</span> <span class="token1">}</span><span class="token1">,</span> valid<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>form<span class="token1">)</span><span class="token1">{</span> <span class="token5">//表单验证通过,提交表单</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span> ajax_url<span class="token1">,</span> data<span class="token1">:</span>$<span class="token1">(</span><span class="token4">"#form"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span> Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">success</span><span class="token1">(</span><span class="token4">"<?=_('操作成功')?>"</span><span class="token1">)</span><span class="token1">;</span> var from <span class="token">=</span> $<span class="token1">(</span><span class="token4">'#page_from'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>from <span class="token">==</span> <span class="token4">'bt'</span><span class="token1">)</span><span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span> <span class="token4">"<?= Yf_Registry::get('url');?>?ctl=Info&met=btinfo"</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span> <span class="token4">"<?= Yf_Registry::get('url');?>?ctl=Info&met=account"</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">typeof</span><span class="token1">(</span>a<span class="token1">.</span>msg<span class="token1">)</span> <span class="token">!=</span> <span class="token4">'undefined'</span><span class="token1">)</span><span class="token1">{</span> Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">error</span><span class="token1">(</span>a<span class="token1">.</span>msg<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">error</span><span class="token1">(</span><span class="token4">"<?=_('操作失败')?>"</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">return</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> ``` ``` 方法:editCertification() ``` <pre class="calibre14">``` $User_InfoModel <span class="token">=</span> <span class="token2">new</span> <span class="token3">User_InfoModel</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $flag <span class="token">=</span> $User_InfoModel<span class="token">-</span><span class="token">></span><span class="token3">editInfo</span><span class="token1">(</span>$user_id<span class="token1">,</span>$edit<span class="token1">)</span><span class="token1">;</span> ``` ``` **实名认证以后,需要在平台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(视图) ``` <pre class="calibre14">``` $<span class="token1">(</span><span class="token4">'#form_company_info'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span> <span class="token5">//验证、ajax</span> ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span> theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span> timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span> rules<span class="token1">:</span> <span class="token1">{</span> tel<span class="token1">:</span><span class="token1">[</span><span class="token">/</span><span class="token">^</span><span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token6">0</span><span class="token">-</span><span class="token6">9</span><span class="token1">]</span><span class="token1">{</span><span class="token6">10</span><span class="token1">}</span>$<span class="token">/</span><span class="token1">,</span><span class="token4">'<?=__('</span>请输入正确的手机号码<span class="token4">')?>'</span><span class="token1">]</span><span class="token1">,</span> zjtel<span class="token1">:</span><span class="token1">[</span><span class="token">/</span><span class="token1">(</span><span class="token">^</span><span class="token6">0</span>\d<span class="token1">{</span><span class="token6">2</span><span class="token1">,</span><span class="token6">3</span><span class="token1">}</span><span class="token1">[</span><span class="token">-</span><span class="token1">]</span><span class="token">?</span>\d<span class="token1">{</span><span class="token6">5</span><span class="token1">,</span><span class="token6">9</span><span class="token1">}</span>$<span class="token1">)</span><span class="token">|</span><span class="token1">(</span><span class="token">^</span><span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token6">0</span><span class="token">-</span><span class="token6">9</span><span class="token1">]</span><span class="token1">{</span><span class="token6">10</span><span class="token1">}</span>$<span class="token1">)</span><span class="token">/</span><span class="token1">,</span><span class="token4">'<?=__('</span>请输入正确的电话号码<span class="token4">')?>'</span><span class="token1">]</span><span class="token1">,</span> daima<span class="token1">:</span><span class="token1">[</span><span class="token">/</span><span class="token">^</span><span class="token1">[</span>a<span class="token">-</span>zA<span class="token">-</span>Z0<span class="token">-</span><span class="token6">9</span><span class="token1">]</span><span class="token1">{</span><span class="token6">8</span><span class="token1">}</span><span class="token">-</span><span class="token1">[</span>a<span class="token">-</span>zA<span class="token">-</span>Z0<span class="token">-</span><span class="token6">9</span><span class="token1">]</span>$<span class="token">/</span><span class="token1">,</span><span class="token4">'<?=__('</span>请输入正确的组织机构代码<span class="token4">')?>'</span><span class="token1">]</span><span class="token1">,</span> times<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>element<span class="token1">,</span> params<span class="token1">)</span><span class="token1">{</span> var start_time <span class="token">=</span> $<span class="token1">(</span><span class="token4">'#start_time'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> var end_time <span class="token">=</span> $<span class="token1">(</span><span class="token4">'#end_time'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>start_time<span class="token">></span>end_time <span class="token">&&</span> end_time<span class="token1">)</span><span class="token1">{</span> <span class="token2">return</span> <span class="token4">'<?=__('</span>不能小于起始时间<span class="token4">')?>'</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">,</span> fields<span class="token1">:</span> <span class="token1">{</span> <span class="token5">//验证规则</span> <span class="token1">}</span><span class="token1">,</span> valid<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>form<span class="token1">)</span><span class="token1">{</span> <span class="token5">//表单验证通过,提交表单</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span> ajax_url<span class="token1">,</span> data<span class="token1">:</span>$<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Shop_Settled&met=index&op=step3"</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">typeof</span><span class="token1">(</span>a<span class="token1">.</span>msg<span class="token1">)</span> <span class="token">==</span> <span class="token4">'undefined'</span> <span class="token">||</span> <span class="token">!</span>a<span class="token1">.</span>msg<span class="token1">)</span><span class="token1">{</span> Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">error</span><span class="token1">(</span><span class="token4">"<?=__('操作失败')?>"</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">error</span><span class="token1">(</span>a<span class="token1">.</span>msg<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">return</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span> $<span class="token1">(</span><span class="token4">'#btn_apply_company_next'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">click</span><span class="token1">(</span><span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">submit</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> ``` ``` 方法:addShopCompany() ``` <pre class="calibre14">``` <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span>$shop_info<span class="token1">)</span><span class="token1">{</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopCompanyModel<span class="token">-</span><span class="token">></span><span class="token3">addCompany</span><span class="token1">(</span>$shop_company<span class="token1">,</span> TRUE<span class="token1">)</span><span class="token1">;</span> $shop_base<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span> <span class="token">=</span> $flag<span class="token1">;</span> $flag1 <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopBaseModel<span class="token">-</span><span class="token">></span><span class="token3">addBase</span><span class="token1">(</span>$shop_base<span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span>$flag1 <span class="token">&&</span> $flag <span class="token">&&</span> $this<span class="token">-</span><span class="token">></span>messageModel<span class="token">-</span><span class="token">></span>sql<span class="token">-</span><span class="token">></span><span class="token3">commitDb</span><span class="token1">(</span><span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> $status <span class="token">=</span> <span class="token6">200</span><span class="token1">;</span> $msg <span class="token">=</span> <span class="token3">__</span><span class="token1">(</span><span class="token4">'success'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>messageModel<span class="token">-</span><span class="token">></span>sql<span class="token">-</span><span class="token">></span><span class="token3">rollBackDb</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $status <span class="token">=</span> <span class="token6">250</span><span class="token1">;</span> $msg <span class="token">=</span> <span class="token3">__</span><span class="token1">(</span><span class="token4">'failure1'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> <span class="token5">//编辑</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopCompanyModel<span class="token">-</span><span class="token">></span><span class="token3">editCompany</span><span class="token1">(</span>$shop_info<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">,</span> $shop_company<span class="token1">)</span><span class="token1">;</span> $flag1 <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopBaseModel<span class="token">-</span><span class="token">></span><span class="token3">editBase</span><span class="token1">(</span>$shop_info<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">,</span> $shop_base<span class="token1">)</span><span class="token1">;</span> $rs_rows <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token3">check_rs</span><span class="token1">(</span>$flag<span class="token1">,</span> $rs_rows<span class="token1">)</span><span class="token1">;</span> <span class="token3">check_rs</span><span class="token1">(</span>$flag1<span class="token1">,</span> $rs_rows<span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token3">is_ok</span><span class="token1">(</span>$rs_rows<span class="token1">)</span> <span class="token">&&</span> $this<span class="token">-</span><span class="token">></span>messageModel<span class="token">-</span><span class="token">></span>sql<span class="token">-</span><span class="token">></span><span class="token3">commitDb</span><span class="token1">(</span><span class="token1">)</span><span class="token1">)</span><span class="token1">{</span> $status <span class="token">=</span> <span class="token6">200</span><span class="token1">;</span> $msg <span class="token">=</span> <span class="token3">__</span><span class="token1">(</span><span class="token4">'success'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>messageModel<span class="token">-</span><span class="token">></span>sql<span class="token">-</span><span class="token">></span><span class="token3">rollBackDb</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $status <span class="token">=</span> <span class="token6">250</span><span class="token1">;</span> $msg <span class="token">=</span> <span class="token3">__</span><span class="token1">(</span><span class="token4">'failure2'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> ``` ``` - 财务资质信息:shop/views/default/Seller/Shop/SettledCtl/step3.php(视图) ``` <pre class="calibre14">``` $<span class="token1">(</span><span class="token4">'#form_company_info'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span> ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span> theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span> timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span> rules<span class="token1">:</span> <span class="token1">{</span> yh<span class="token1">:</span><span class="token1">[</span><span class="token">/</span><span class="token">^</span><span class="token1">(</span>\d<span class="token1">{</span><span class="token6">16</span><span class="token1">}</span><span class="token">|</span>\d<span class="token1">{</span><span class="token6">19</span><span class="token1">}</span><span class="token1">)</span>$<span class="token">/</span><span class="token1">,</span><span class="token4">"<?=__('请填写正确的银行账号')?>"</span><span class="token1">]</span><span class="token1">,</span> <span class="token1">}</span><span class="token1">,</span> fields<span class="token1">:</span> <span class="token1">{</span> <span class="token5">//验证规则</span> <span class="token1">}</span><span class="token1">,</span> valid<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>form<span class="token1">)</span><span class="token1">{</span> <span class="token5">//表单验证通过,提交表单</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span> ajax_url<span class="token1">,</span> data<span class="token1">:</span>$<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Shop_Settled&met=index&op=step4&apply=<?=$apply?>"</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token3">alert</span><span class="token1">(</span><span class="token4">"<?=__('操作失败!')?>"</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> $<span class="token1">(</span><span class="token4">'#btn_apply_company_next'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">click</span><span class="token1">(</span><span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">submit</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> ``` ``` 方法:editShopCompany() ``` <pre class="calibre14">``` $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopCompanyModel<span class="token">-</span><span class="token">></span><span class="token3">editCompany</span><span class="token1">(</span>$shop_id<span class="token1">,</span> $shop_company<span class="token1">)</span><span class="token1">;</span> $flag1 <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopBaseModel<span class="token">-</span><span class="token">></span><span class="token3">editBase</span><span class="token1">(</span>$shop_id<span class="token1">,</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_status'</span><span class="token">=</span><span class="token">></span><span class="token6">9</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> ``` ``` - 店铺经营信息:shop/views/default/Seller/Shop/SettledCtl/step4.php(视图) ``` <pre class="calibre14">``` $<span class="token1">(</span><span class="token4">'#form_company_info'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span> ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span> theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span> timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span> rules<span class="token1">:</span> <span class="token1">{</span> <span class="token1">}</span><span class="token1">,</span> fields<span class="token1">:</span> <span class="token1">{</span> <span class="token4">'shop_name'</span><span class="token1">:</span> <span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'shop_grade_id'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'joinin_year'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'shop_class_id'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'shop_class_bind_id'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token1">}</span><span class="token1">,</span> valid<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>form<span class="token1">)</span><span class="token1">{</span> <span class="token5">//表单验证通过,提交表单</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span> ajax_url<span class="token1">,</span> data<span class="token1">:</span>$<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Shop_Settled&met=index&op=step5&apply=<?=$apply?>"</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token3">alert</span><span class="token1">(</span><span class="token4">"<?=__('操作失败!')?>"</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> $<span class="token1">(</span><span class="token4">'#btn_apply_company_next'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">click</span><span class="token1">(</span><span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">submit</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> ``` ``` 方法:editShopBase() ``` <pre class="calibre14">``` $shopClassBind <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopClassBindModel<span class="token">-</span><span class="token">></span><span class="token3">listByWhere</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_id'</span><span class="token">=</span><span class="token">></span>$shop_id<span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>$shopClassBind<span class="token1">[</span><span class="token4">'items'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">{</span> $calss_id <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> foreach <span class="token1">(</span>$shopClassBind<span class="token1">[</span><span class="token4">'items'</span><span class="token1">]</span> as $val<span class="token1">)</span><span class="token1">{</span> $calss_id<span class="token1">[</span><span class="token1">]</span> <span class="token">=</span> $val<span class="token1">[</span><span class="token4">'shop_class_bind_id'</span><span class="token1">]</span><span class="token1">;</span> <span class="token1">}</span> $this<span class="token">-</span><span class="token">></span>shopClassBindModel<span class="token">-</span><span class="token">></span><span class="token3">removeClassBind</span><span class="token1">(</span>$calss_id<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> foreach <span class="token1">(</span>$product_class_id as $key <span class="token">=</span><span class="token">></span> $value<span class="token1">)</span> <span class="token1">{</span> $shop_class<span class="token1">[</span><span class="token4">'product_class_id'</span><span class="token1">]</span> <span class="token">=</span> $value<span class="token1">;</span> $shop_class<span class="token1">[</span><span class="token4">'commission_rate'</span><span class="token1">]</span> <span class="token">=</span> $commission_rate<span class="token1">[</span>$key<span class="token1">]</span><span class="token1">;</span> $shop_class<span class="token1">[</span><span class="token4">'shop_class_bind_enable'</span><span class="token1">]</span> <span class="token">=</span> <span class="token6">2</span><span class="token1">;</span> $shop_class<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span> <span class="token">=</span> $shop_id<span class="token1">;</span> $flag1 <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopClassBindModel<span class="token">-</span><span class="token">></span><span class="token3">addClassBind</span><span class="token1">(</span>$shop_class<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` (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(视图) ``` <pre class="calibre14">``` $<span class="token1">(</span><span class="token4">'#form_company_info'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span> <span class="token5">//验证、ajax</span> ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span> theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span> timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span> rules<span class="token1">:</span> <span class="token1">{</span> tel<span class="token1">:</span><span class="token1">[</span><span class="token">/</span><span class="token">^</span><span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token6">0</span><span class="token">-</span><span class="token6">9</span><span class="token1">]</span><span class="token1">{</span><span class="token6">10</span><span class="token1">}</span>$<span class="token">/</span><span class="token1">,</span><span class="token4">'<?=__('</span>请输入正确的手机号码<span class="token4">')?>'</span><span class="token1">]</span><span class="token1">,</span> zjtel<span class="token1">:</span><span class="token1">[</span><span class="token">/</span><span class="token1">(</span><span class="token">^</span><span class="token6">0</span>\d<span class="token1">{</span><span class="token6">2</span><span class="token1">,</span><span class="token6">3</span><span class="token1">}</span><span class="token1">[</span><span class="token">-</span><span class="token1">]</span><span class="token">?</span>\d<span class="token1">{</span><span class="token6">5</span><span class="token1">,</span><span class="token6">9</span><span class="token1">}</span>$<span class="token1">)</span><span class="token">|</span><span class="token1">(</span><span class="token">^</span><span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">[</span><span class="token6">0</span><span class="token">-</span><span class="token6">9</span><span class="token1">]</span><span class="token1">{</span><span class="token6">10</span><span class="token1">}</span>$<span class="token1">)</span><span class="token">/</span><span class="token1">,</span><span class="token4">'<?=__('</span>请输入正确的电话号码<span class="token4">')?>'</span><span class="token1">]</span><span class="token1">,</span> daima<span class="token1">:</span><span class="token1">[</span><span class="token">/</span><span class="token">^</span><span class="token1">[</span>a<span class="token">-</span>zA<span class="token">-</span>Z0<span class="token">-</span><span class="token6">9</span><span class="token1">]</span><span class="token1">{</span><span class="token6">8</span><span class="token1">}</span><span class="token">-</span><span class="token1">[</span>a<span class="token">-</span>zA<span class="token">-</span>Z0<span class="token">-</span><span class="token6">9</span><span class="token1">]</span>$<span class="token">/</span><span class="token1">,</span><span class="token4">'<?=__('</span>请输入正确的组织机构代码<span class="token4">')?>'</span><span class="token1">]</span><span class="token1">,</span> times<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>element<span class="token1">,</span> params<span class="token1">)</span><span class="token1">{</span> var start_time <span class="token">=</span> $<span class="token1">(</span><span class="token4">'#start_time'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> var end_time <span class="token">=</span> $<span class="token1">(</span><span class="token4">'#end_time'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>start_time<span class="token">></span>end_time <span class="token">&&</span> end_time<span class="token1">)</span><span class="token1">{</span> <span class="token2">return</span> <span class="token4">'<?=__('</span>不能小于起始时间<span class="token4">')?>'</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">,</span> fields<span class="token1">:</span> <span class="token1">{</span> <span class="token5">//验证规则</span> <span class="token1">}</span><span class="token1">,</span> valid<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>form<span class="token1">)</span><span class="token1">{</span> <span class="token5">//表单验证通过,提交表单</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span> ajax_url<span class="token1">,</span> data<span class="token1">:</span>$<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Shop_Settled&met=index&op=step3"</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">typeof</span><span class="token1">(</span>a<span class="token1">.</span>msg<span class="token1">)</span> <span class="token">==</span> <span class="token4">'undefined'</span> <span class="token">||</span> <span class="token">!</span>a<span class="token1">.</span>msg<span class="token1">)</span><span class="token1">{</span> Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">error</span><span class="token1">(</span><span class="token4">"<?=__('操作失败')?>"</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">error</span><span class="token1">(</span>a<span class="token1">.</span>msg<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">return</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span> $<span class="token1">(</span><span class="token4">'#btn_apply_company_next'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">click</span><span class="token1">(</span><span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">submit</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> ``` ``` 方法:addShopCompany() ``` <pre class="calibre14">``` <span class="token2">if</span> <span class="token1">(</span><span class="token">!</span>$shop_info<span class="token1">)</span><span class="token1">{</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopCompanyModel<span class="token">-</span><span class="token">></span><span class="token3">addCompany</span><span class="token1">(</span>$shop_company<span class="token1">,</span> TRUE<span class="token1">)</span><span class="token1">;</span> $shop_base<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span> <span class="token">=</span> $flag<span class="token1">;</span> $flag1 <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopBaseModel<span class="token">-</span><span class="token">></span><span class="token3">addBase</span><span class="token1">(</span>$shop_base<span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span>$flag1 <span class="token">&&</span> $flag <span class="token">&&</span> $this<span class="token">-</span><span class="token">></span>messageModel<span class="token">-</span><span class="token">></span>sql<span class="token">-</span><span class="token">></span><span class="token3">commitDb</span><span class="token1">(</span><span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> $status <span class="token">=</span> <span class="token6">200</span><span class="token1">;</span> $msg <span class="token">=</span> <span class="token3">__</span><span class="token1">(</span><span class="token4">'success'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>messageModel<span class="token">-</span><span class="token">></span>sql<span class="token">-</span><span class="token">></span><span class="token3">rollBackDb</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $status <span class="token">=</span> <span class="token6">250</span><span class="token1">;</span> $msg <span class="token">=</span> <span class="token3">__</span><span class="token1">(</span><span class="token4">'failure1'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> <span class="token5">//编辑</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopCompanyModel<span class="token">-</span><span class="token">></span><span class="token3">editCompany</span><span class="token1">(</span>$shop_info<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">,</span> $shop_company<span class="token1">)</span><span class="token1">;</span> $flag1 <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopBaseModel<span class="token">-</span><span class="token">></span><span class="token3">editBase</span><span class="token1">(</span>$shop_info<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">,</span> $shop_base<span class="token1">)</span><span class="token1">;</span> $rs_rows <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token3">check_rs</span><span class="token1">(</span>$flag<span class="token1">,</span> $rs_rows<span class="token1">)</span><span class="token1">;</span> <span class="token3">check_rs</span><span class="token1">(</span>$flag1<span class="token1">,</span> $rs_rows<span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span><span class="token3">is_ok</span><span class="token1">(</span>$rs_rows<span class="token1">)</span> <span class="token">&&</span> $this<span class="token">-</span><span class="token">></span>messageModel<span class="token">-</span><span class="token">></span>sql<span class="token">-</span><span class="token">></span><span class="token3">commitDb</span><span class="token1">(</span><span class="token1">)</span><span class="token1">)</span><span class="token1">{</span> $status <span class="token">=</span> <span class="token6">200</span><span class="token1">;</span> $msg <span class="token">=</span> <span class="token3">__</span><span class="token1">(</span><span class="token4">'success'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>messageModel<span class="token">-</span><span class="token">></span>sql<span class="token">-</span><span class="token">></span><span class="token3">rollBackDb</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $status <span class="token">=</span> <span class="token6">250</span><span class="token1">;</span> $msg <span class="token">=</span> <span class="token3">__</span><span class="token1">(</span><span class="token4">'failure2'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> ``` ``` - 财务资质信息:shop/views/default/Seller/Shop/SettledCtl/step3.php(视图) ``` <pre class="calibre14">``` $<span class="token1">(</span><span class="token4">'#form_company_info'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span> ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span> theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span> timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span> rules<span class="token1">:</span> <span class="token1">{</span> yh<span class="token1">:</span><span class="token1">[</span><span class="token">/</span><span class="token">^</span><span class="token1">(</span>\d<span class="token1">{</span><span class="token6">16</span><span class="token1">}</span><span class="token">|</span>\d<span class="token1">{</span><span class="token6">19</span><span class="token1">}</span><span class="token1">)</span>$<span class="token">/</span><span class="token1">,</span><span class="token4">"<?=__('请填写正确的银行账号')?>"</span><span class="token1">]</span><span class="token1">,</span> <span class="token1">}</span><span class="token1">,</span> fields<span class="token1">:</span> <span class="token1">{</span> <span class="token5">//验证规则</span> <span class="token1">}</span><span class="token1">,</span> valid<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>form<span class="token1">)</span><span class="token1">{</span> <span class="token5">//表单验证通过,提交表单</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span> ajax_url<span class="token1">,</span> data<span class="token1">:</span>$<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Shop_Settled&met=index&op=step4&apply=<?=$apply?>"</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token3">alert</span><span class="token1">(</span><span class="token4">"<?=__('操作失败!')?>"</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> $<span class="token1">(</span><span class="token4">'#btn_apply_company_next'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">click</span><span class="token1">(</span><span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">submit</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> ``` ``` 方法:editShopCompany() ``` <pre class="calibre14">``` $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopCompanyModel<span class="token">-</span><span class="token">></span><span class="token3">editCompany</span><span class="token1">(</span>$shop_id<span class="token1">,</span> $shop_company<span class="token1">)</span><span class="token1">;</span> $flag1 <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopBaseModel<span class="token">-</span><span class="token">></span><span class="token3">editBase</span><span class="token1">(</span>$shop_id<span class="token1">,</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_status'</span><span class="token">=</span><span class="token">></span><span class="token6">9</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> ``` ``` - 店铺经营信息:shop/views/default/Seller/Shop/SettledCtl/step4.php(视图) ``` <pre class="calibre14">``` $<span class="token1">(</span><span class="token4">'#form_company_info'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span> ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span> theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span> timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span> rules<span class="token1">:</span> <span class="token1">{</span> <span class="token1">}</span><span class="token1">,</span> fields<span class="token1">:</span> <span class="token1">{</span> <span class="token4">'shop_name'</span><span class="token1">:</span> <span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'shop_grade_id'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'joinin_year'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'shop_class_id'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'shop_class_bind_id'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token1">}</span><span class="token1">,</span> valid<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>form<span class="token1">)</span><span class="token1">{</span> <span class="token5">//表单验证通过,提交表单</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span> ajax_url<span class="token1">,</span> data<span class="token1">:</span>$<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Shop_Settled&met=index&op=step5&apply=<?=$apply?>"</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token3">alert</span><span class="token1">(</span><span class="token4">"<?=__('操作失败!')?>"</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> $<span class="token1">(</span><span class="token4">'#btn_apply_company_next'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">click</span><span class="token1">(</span><span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span><span class="token4">"#form_company_info"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">submit</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> ``` ``` 方法:editShopBase() ``` <pre class="calibre14">``` $shopClassBind <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopClassBindModel<span class="token">-</span><span class="token">></span><span class="token3">listByWhere</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_id'</span><span class="token">=</span><span class="token">></span>$shop_id<span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>$shopClassBind<span class="token1">[</span><span class="token4">'items'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">{</span> $calss_id <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> foreach <span class="token1">(</span>$shopClassBind<span class="token1">[</span><span class="token4">'items'</span><span class="token1">]</span> as $val<span class="token1">)</span><span class="token1">{</span> $calss_id<span class="token1">[</span><span class="token1">]</span> <span class="token">=</span> $val<span class="token1">[</span><span class="token4">'shop_class_bind_id'</span><span class="token1">]</span><span class="token1">;</span> <span class="token1">}</span> $this<span class="token">-</span><span class="token">></span>shopClassBindModel<span class="token">-</span><span class="token">></span><span class="token3">removeClassBind</span><span class="token1">(</span>$calss_id<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> foreach <span class="token1">(</span>$product_class_id as $key <span class="token">=</span><span class="token">></span> $value<span class="token1">)</span> <span class="token1">{</span> $shop_class<span class="token1">[</span><span class="token4">'product_class_id'</span><span class="token1">]</span> <span class="token">=</span> $value<span class="token1">;</span> $shop_class<span class="token1">[</span><span class="token4">'commission_rate'</span><span class="token1">]</span> <span class="token">=</span> $commission_rate<span class="token1">[</span>$key<span class="token1">]</span><span class="token1">;</span> $shop_class<span class="token1">[</span><span class="token4">'shop_class_bind_enable'</span><span class="token1">]</span> <span class="token">=</span> <span class="token6">2</span><span class="token1">;</span> $shop_class<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span> <span class="token">=</span> $shop_id<span class="token1">;</span> $flag1 <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopClassBindModel<span class="token">-</span><span class="token">></span><span class="token3">addClassBind</span><span class="token1">(</span>$shop_class<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` **提交申请,平台审核** 平台审核控制器: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(视图) ``` <pre class="calibre14">``` $<span class="token1">(</span><span class="token4">'#form'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span> ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span> theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span> timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span> rules<span class="token1">:</span> <span class="token1">{</span> <span class="token1">}</span><span class="token1">,</span> fields<span class="token1">:</span> <span class="token1">{</span> <span class="token4">'payment_voucher'</span><span class="token1">:</span> <span class="token4">'required;'</span><span class="token1">,</span> <span class="token4">'payment_voucher_explain'</span><span class="token1">:</span><span class="token4">'required;'</span><span class="token1">,</span> <span class="token1">}</span><span class="token1">,</span> valid<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>form<span class="token1">)</span><span class="token1">{</span> <span class="token5">//表单验证通过,提交表单</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span> ajax_url<span class="token1">,</span> data<span class="token1">:</span>$<span class="token1">(</span><span class="token4">"#form"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span> <span class="token1">{</span> location<span class="token1">.</span>href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Shop_Settled&met=index&op=step5&apply=<?=$apply?>"</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> <span class="token3">alert</span><span class="token1">(</span><span class="token4">"<?=__('操作失败')?>"</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> $<span class="token1">(</span><span class="token4">'#btn_apply_company_next'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">click</span><span class="token1">(</span><span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span><span class="token4">"#form"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">submit</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token1">)</span><span class="token1">;</span> ``` ``` 方法:shopPaystatus() ``` <pre class="calibre14">``` <span class="token5">//添加卖家</span> $check_seller <span class="token">=</span> $SellerBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getByWhere</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_id'</span><span class="token">=</span><span class="token">></span>$shop_id<span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span><span class="token">!</span>$check_seller<span class="token1">)</span><span class="token1">{</span> $seller_base<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span> <span class="token">=</span> $shop_id<span class="token1">;</span> $seller_base<span class="token1">[</span><span class="token4">'user_id'</span><span class="token1">]</span> <span class="token">=</span> Perm<span class="token1">:</span><span class="token1">:</span>$userId<span class="token1">;</span> $seller_base<span class="token1">[</span><span class="token4">'seller_name'</span><span class="token1">]</span> <span class="token">=</span> Perm<span class="token1">:</span><span class="token1">:</span>$row<span class="token1">[</span><span class="token4">'user_account'</span><span class="token1">]</span><span class="token1">;</span> $seller_base<span class="token1">[</span><span class="token4">'seller_is_admin'</span><span class="token1">]</span> <span class="token">=</span> <span class="token6">1</span><span class="token1">;</span> $seller_add <span class="token">=</span> $SellerBaseModel<span class="token">-</span><span class="token">></span><span class="token3">addBase</span><span class="token1">(</span>$seller_base<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $seller_add <span class="token">=</span> <span class="token6">true</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` **申请店铺返回上一步** 方法:\_getRpStep() ``` <pre class="calibre14">``` switch <span class="token1">(</span>$shop_step_info<span class="token1">[</span><span class="token4">'rp'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">{</span> case <span class="token4">'step0'</span><span class="token1">:</span> <span class="token5">//1.没有入驻信息,2.支持所有的入驻</span> case <span class="token4">'step1'</span><span class="token1">:</span> <span class="token5">//没有入驻信息,仅支持单方面入驻,如果支持所有入驻,就退到step0</span> <span class="token2">if</span><span class="token1">(</span>$shop_step_info<span class="token1">[</span><span class="token4">'shop_status'</span><span class="token1">]</span> <span class="token">==</span> <span class="token4">'-1'</span><span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>Web_ConfigModel<span class="token1">:</span><span class="token1">:</span><span class="token3">value</span><span class="token1">(</span><span class="token4">'join_type'</span><span class="token1">)</span> <span class="token">==</span> <span class="token6">3</span><span class="token1">)</span><span class="token1">{</span> $op <span class="token">=</span> <span class="token4">'step0'</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $op <span class="token">=</span> <span class="token4">'step1'</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $status <span class="token">=</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">break</span><span class="token1">;</span> case <span class="token4">'step2'</span><span class="token1">:</span> <span class="token5">//1. 企业入驻 2. shop_status in 4,5,6,7,8,9</span> case <span class="token4">'pstep2'</span><span class="token1">:</span> <span class="token5">//1. 个人入驻 2. shop_status in 4,5,6,7,8,9</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">in_array</span><span class="token1">(</span>$shop_step_info<span class="token1">[</span><span class="token4">'shop_status'</span><span class="token1">]</span><span class="token1">,</span><span class="token3">array</span><span class="token1">(</span><span class="token6">4</span><span class="token1">,</span><span class="token6">5</span><span class="token1">,</span><span class="token6">6</span><span class="token1">,</span><span class="token6">7</span><span class="token1">,</span><span class="token6">8</span><span class="token1">,</span><span class="token6">9</span><span class="token1">)</span><span class="token1">)</span><span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>$shop_step_info<span class="token1">[</span><span class="token4">'shop_business'</span><span class="token1">]</span> <span class="token">==</span> <span class="token6">1</span><span class="token1">)</span><span class="token1">{</span> $op <span class="token">=</span> <span class="token4">'step2'</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $op <span class="token">=</span> <span class="token4">'pstep2'</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $status <span class="token">=</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">break</span><span class="token1">;</span> case <span class="token4">'step3'</span><span class="token1">:</span> <span class="token5">//1. 企业入驻 2. shop_status in 4,5,6,7,8,9</span> case <span class="token4">'pstep3'</span><span class="token1">:</span> <span class="token5">//1. 个人入驻 2. shop_status in 4,5,6,7,8,9</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">in_array</span><span class="token1">(</span>$shop_step_info<span class="token1">[</span><span class="token4">'shop_status'</span><span class="token1">]</span><span class="token1">,</span><span class="token3">array</span><span class="token1">(</span><span class="token6">4</span><span class="token1">,</span><span class="token6">5</span><span class="token1">,</span><span class="token6">6</span><span class="token1">,</span><span class="token6">7</span><span class="token1">,</span><span class="token6">8</span><span class="token1">,</span><span class="token6">9</span><span class="token1">)</span><span class="token1">)</span><span class="token1">)</span><span class="token1">{</span> <span class="token2">if</span><span class="token1">(</span>$shop_step_info<span class="token1">[</span><span class="token4">'shop_business'</span><span class="token1">]</span> <span class="token">==</span> <span class="token6">1</span><span class="token1">)</span><span class="token1">{</span> $op <span class="token">=</span> <span class="token4">'step3'</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $op <span class="token">=</span> <span class="token4">'pstep3'</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $status <span class="token">=</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">break</span><span class="token1">;</span> case <span class="token4">'step4'</span><span class="token1">:</span> <span class="token5">//1. shop_status in 4,5,6,7,8,9</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">in_array</span><span class="token1">(</span>$shop_step_info<span class="token1">[</span><span class="token4">'shop_status'</span><span class="token1">]</span><span class="token1">,</span><span class="token3">array</span><span class="token1">(</span><span class="token6">4</span><span class="token1">,</span><span class="token6">5</span><span class="token1">,</span><span class="token6">6</span><span class="token1">,</span><span class="token6">7</span><span class="token1">,</span><span class="token6">9</span><span class="token1">)</span><span class="token1">)</span><span class="token1">)</span><span class="token1">{</span> $op <span class="token">=</span> <span class="token4">'step4'</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $status <span class="token">=</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">break</span><span class="token1">;</span> case <span class="token4">'step5'</span><span class="token1">:</span> <span class="token5">//1. shop_status == 7</span> <span class="token2">if</span><span class="token1">(</span>$shop_step_info<span class="token1">[</span><span class="token4">'shop_status'</span><span class="token1">]</span> <span class="token">==</span> <span class="token6">7</span><span class="token1">)</span><span class="token1">{</span> $op <span class="token">=</span> <span class="token4">'step5'</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $status <span class="token">=</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">break</span><span class="token1">;</span> default <span class="token1">:</span> $status <span class="token">=</span> <span class="token6">false</span><span class="token1">;</span> <span class="token2">break</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` **平台审核店铺** 平台审核控制器: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:审核未通过 ``` <pre class="calibre15">``` public static $shop_status <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span> <span class="token4">"0"</span> <span class="token">=</span><span class="token">></span> <span class="token4">"关闭"</span><span class="token1">,</span> <span class="token4">"1"</span> <span class="token">=</span><span class="token">></span> <span class="token4">"待审核信息"</span><span class="token1">,</span> <span class="token4">"2"</span> <span class="token">=</span><span class="token">></span> <span class="token4">"待审核付款"</span><span class="token1">,</span> <span class="token4">"3"</span> <span class="token">=</span><span class="token">></span> <span class="token4">"开店成功"</span><span class="token1">,</span> <span class="token4">"4"</span> <span class="token">=</span><span class="token">></span> <span class="token4">"审核未通过"</span> <span class="token1">)</span><span class="token1">;</span> ``` ```