💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 店铺及商品提示栏 #### 1.视图展示 文件路径:\\shop\\views\\default\\Seller\\IndexCtl\\index.php ``` <pre class="calibre14">``` <span class="token"><</span>div class<span class="token">=</span><span class="token4">"m white-panel"</span><span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"pannel_div"</span><span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"mt"</span><span class="token">></span> <span class="token"><</span>h3 class<span class="token">=</span><span class="token4">"bbc_seller_border"</span><span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'店铺及商品提示'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>h3<span class="token">></span> <span class="token"><</span>h5<span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'您需要关注的店铺信息以及待处理事项'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>h5<span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"mc"</span><span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"focus"</span><span class="token">></span> <span class="token"><</span>span<span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'店铺商品发布情况'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span>: <span class="token"><</span><span class="token">?</span><span class="token">=</span> $goods_state_normal_num<span class="token">+</span>$goods_state_offline_num<span class="token">+</span>$goods_state_illegal_num <span class="token">?</span><span class="token">></span> <span class="token">/</span> <span class="token"><</span><span class="token">?</span><span class="token">=</span> $shop_grade_goods_limit <span class="token">?</span> $shop_grade_goods_limit <span class="token1">:</span> <span class="token4">'不限'</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>span<span class="token">></span> <span class="token"><</span>span<span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'图片空间使用'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span>: <span class="token"><</span><span class="token">?</span><span class="token">=</span> $shop_album_num <span class="token">?</span><span class="token">></span> <span class="token">/</span> <span class="token"><</span><span class="token">?</span><span class="token">=</span> $shop_grade_album_limit <span class="token">?</span> $shop_grade_album_limit <span class="token1">:</span> <span class="token4">'不限'</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>span<span class="token">></span><span class="token"><</span><span class="token">/</span>span<span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span> <span class="token"><</span>ul class<span class="token">=</span><span class="token4">"fn-clear"</span><span class="token">></span> <span class="token"><</span>li<span class="token">></span><span class="token"><</span>a class<span class="token">=</span><span class="token4">"<?=$goods_state_normal_num?'num bbc_border bbc_color':''?>"</span> href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Goods&met=online&typ=e"</span><span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'出售中商品'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span><span class="token"><</span>em class<span class="token">=</span><span class="token4">"bbc_seller_bg"</span><span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span>$goods_state_normal_num<span class="token">?</span>$goods_state_normal_num<span class="token1">:</span><span class="token4">''</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>em<span class="token">></span><span class="token"><</span><span class="token">/</span>a<span class="token">></span><span class="token"><</span><span class="token">/</span>li<span class="token">></span> <span class="token"><</span>li<span class="token">></span><span class="token"><</span>a class<span class="token">=</span><span class="token4">"<?=$goods_verify_waiting_num?'num num1 bbc_border bbc_color':''?>"</span> href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Goods&met=offline&met=verify&typ=e&op=3"</span><span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'待审核商品'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span><span class="token"><</span>em class<span class="token">=</span><span class="token4">"bbc_seller_bg"</span><span class="token">></span> <span class="token"><</span><span class="token">?</span><span class="token">=</span>$goods_verify_waiting_num<span class="token">?</span>$goods_verify_waiting_num<span class="token1">:</span><span class="token4">''</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>em<span class="token">></span><span class="token"><</span><span class="token">/</span>a<span class="token">></span><span class="token"><</span><span class="token">/</span>li<span class="token">></span> <span class="token"><</span>li<span class="token">></span><span class="token"><</span>a class<span class="token">=</span><span class="token4">"<?=$goods_state_offline_num?'num bbc_border bbc_color':''?>"</span> href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Goods&met=offline&typ=e&op=1"</span> <span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'仓库中商品'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span> <span class="token"><</span>em class<span class="token">=</span><span class="token4">"bbc_seller_bg"</span><span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span>$goods_state_offline_num <span class="token">?</span> $goods_state_offline_num <span class="token1">:</span> <span class="token4">''</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>em<span class="token">></span><span class="token"><</span><span class="token">/</span>a<span class="token">></span><span class="token"><</span><span class="token">/</span>li<span class="token">></span> <span class="token"><</span>li<span class="token">></span><span class="token"><</span>a class<span class="token">=</span><span class="token4">"<?=$goods_state_illegal_num?'num num1 bbc_border bbc_color':''?>"</span> href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Goods&met=lockup&typ=e&op=2"</span> <span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'违规下架商品'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span> <span class="token"><</span>em class<span class="token">=</span><span class="token4">"bbc_seller_bg"</span><span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span>$goods_state_illegal_num<span class="token">?</span> $goods_state_illegal_num<span class="token1">:</span> <span class="token4">''</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>em<span class="token">></span><span class="token"><</span><span class="token">/</span>a<span class="token">></span><span class="token"><</span><span class="token">/</span>li<span class="token">></span> <span class="token"><</span><span class="token">/</span>ul<span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span> ``` ``` #### 2.数据获取 接口地址:index.php?ctl=Seller\_Index&met=index&typ=e 接口文件:\\shop\\controllers\\Seller\\IndexCtl.php 控制器:Seller\_IndexCtl 方法:index() ``` <pre class="calibre15">``` <span class="token5">//当前商品数量统计</span> $Goods_CommonModel <span class="token">=</span> <span class="token2">new</span> <span class="token3">Goods_CommonModel</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token5">//出售中的商品</span> $goods_state_normal_num <span class="token">=</span> $Goods_CommonModel<span class="token">-</span><span class="token">></span><span class="token3">getCommonStateNum</span><span class="token1">(</span>$shop<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">,</span> Goods_CommonModel<span class="token1">:</span><span class="token1">:</span>GOODS_STATE_NORMAL<span class="token1">,</span>Goods_CommonModel<span class="token1">:</span><span class="token1">:</span>GOODS_VERIFY_ALLOW<span class="token1">)</span><span class="token1">;</span> <span class="token5">//仓库中商品</span> $goods_state_offline_num <span class="token">=</span> $Goods_CommonModel<span class="token">-</span><span class="token">></span><span class="token3">getCommonStateNum</span><span class="token1">(</span>$shop<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">,</span> Goods_CommonModel<span class="token1">:</span><span class="token1">:</span>GOODS_STATE_OFFLINE<span class="token1">)</span><span class="token1">;</span> <span class="token5">//违规下架商品</span> $goods_state_illegal_num <span class="token">=</span> $Goods_CommonModel<span class="token">-</span><span class="token">></span><span class="token3">getCommonStateNum</span><span class="token1">(</span>$shop<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">,</span> Goods_CommonModel<span class="token1">:</span><span class="token1">:</span>GOODS_STATE_ILLEGAL<span class="token1">)</span><span class="token1">;</span> <span class="token5">//待审核商品</span> $goods_verify_waiting_num <span class="token">=</span> $Goods_CommonModel<span class="token">-</span><span class="token">></span><span class="token3">getCommonVerifyNum</span><span class="token1">(</span>$shop<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">;</span> ``` ```