企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 店铺信息 文件路径:shop/controllers/Seller/Shop/InfoCtl.php 首先判断一下是不是自营店铺如果是自营店铺就没有店铺公司信息以及续费申请 ``` <pre class="calibre14">``` $shop_id <span class="token">=</span> Perm<span class="token1">:</span><span class="token1">:</span>$shopId<span class="token1">;</span> $shop <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">getOne</span><span class="token1">(</span>$shop_id<span class="token1">)</span><span class="token1">;</span> ``` ``` 一、经营类目 经营类目状态:参数:shop\_class\_bind\_enable ``` <pre class="calibre14">``` public static $shop_class_bind_enable <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="token1">;</span> ``` ``` 1.添加类目 控制器:shop/controllers/Seller/Shop/InfoCtl.php ->info() 视图:根据URL获得参数act的值,判断视图 ``` <pre class="calibre14">``` <span class="token2">if</span> <span class="token1">(</span>$act <span class="token">==</span> <span class="token4">'renew'</span><span class="token1">)</span> <span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>view<span class="token">-</span><span class="token">></span><span class="token3">setMet</span><span class="token1">(</span><span class="token4">'renew'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> elseif <span class="token1">(</span>$act <span class="token">==</span> <span class="token4">'info'</span><span class="token1">)</span> <span class="token1">{</span> <span class="token5">//店铺信息</span> <span class="token5">//视图:info.php</span> <span class="token1">}</span> <span class="token2">else</span> <span class="token1">{</span> $this<span class="token">-</span><span class="token">></span>view<span class="token">-</span><span class="token">></span><span class="token3">setMet</span><span class="token1">(</span><span class="token4">'category'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` - 类目列表视图:shop/views/default/Seller/Shop/InfoCtl/category.php - 添加类目视图: shop/views/default/Seller/Shop/InfoCtl/addcategory.php 方法:addcategoryInfo()、addcategoryrow() - 申请续签shop/views/default/Seller/Shop/InfoCtl/renew.php - 店铺信息视图:shop/views/default/Seller/Shop/InfoCtl/info.php 二、店铺信息 如果店铺是平台自营店铺,则没有店铺信息 控制器:shop/controllers/Seller/Shop/InfoCtl.php ->info() 模型:shop/models/shop/BaseModel.php、shop/models/shop/CompanyModel.php 视图:shop/views/default/Seller/Shop/InfoCtl/info.php 详细信息:`$data = $this->shopBaseModel->getbaseAllList($shop_id);` 三、续签申请 如果店铺是平台自营店铺,则没有续签申请 控制器:shop/controllers/Seller/Shop/InfoCtl.php 模型:shop/models/shop/RenewalModel.php、shop/models/shop/GradeModel.php 视图:shop/views/default/Seller/Shop/InfoCtl/renew.php ``` <pre class="calibre14">``` <span class="token2">if</span> <span class="token1">(</span>$act <span class="token">==</span> <span class="token4">'renew'</span><span class="token1">)</span> <span class="token1">{</span> <span class="token5">//推算出续签时间(前一个月即可申请)</span> $frontmonth <span class="token">=</span> <span class="token3">date</span><span class="token1">(</span><span class="token4">"Y-m-d H:i:s"</span><span class="token1">,</span> <span class="token3">strtotime</span><span class="token1">(</span><span class="token4">"$shop[shop_end_time] - 1 month"</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> $date <span class="token">=</span> <span class="token3">date</span><span class="token1">(</span><span class="token4">"Y-m-d h:i:s"</span><span class="token1">,</span> <span class="token3">time</span><span class="token1">(</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> $data <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopRenewalModel<span class="token">-</span><span class="token">></span><span class="token3">getRenewalList</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> $grade <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopGradeModel<span class="token">-</span><span class="token">></span><span class="token3">getGradeWhere</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $this<span class="token">-</span><span class="token">></span>view<span class="token">-</span><span class="token">></span><span class="token3">setMet</span><span class="token1">(</span><span class="token4">'renew'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` 提交申请:`$('#form').validator({})` 申请状态:申请成功、申请中(参数:status、模型:shop/models/shop/RenewalModel.php) ``` <pre class="calibre14">``` public static $renewal_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="token1">;</span> ``` ``` 方法:addRenew(); `$flag = $this->shopRenewalModel->addRenewal($renew_row);` 删除:delRenew(); `$flag = $this->shopRenewalModel->removeRenewal($renew_id);`