💎一站式轻松地调用各大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>a href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Trade_Order&met=physical&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><span class="token">/</span>a<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>a href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Service_Complain&met=index&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>nbsp<span class="token1">;</span><span class="token"><</span><span class="token">?</span><span class="token">=</span> $complain_unsolved_count <span class="token">?</span> $complain_unsolved_count <span class="token1">:</span> <span class="token6">0</span> <span class="token">?</span><span class="token">></span> <span class="token">/</span> <span class="token"><</span><span class="token">?</span><span class="token">=</span> $complain_all_count <span class="token">?</span> $complain_all_count <span class="token1">:</span> <span class="token6">0</span><span class="token">?</span><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>span<span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span> <span class="token"><</span>ul id<span class="token">=</span><span class="token4">"order_num_list"</span><span class="token">></span> <span class="token"><</span>li<span class="token">></span><span class="token"><</span>a href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Trade_Order&met=getPhysicalNew&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><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 href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Trade_Deliver&met=deliver&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><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 href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Service_Return&met=orderReturn&typ=e"</span> class<span class="token">=</span><span class="token4">""</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>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 href<span class="token">=</span><span class="token4">"./index.php?ctl=Seller_Service_Return&met=goodsReturn&typ=e"</span> class<span class="token">=</span><span class="token4">""</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>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> ``` ``` jq中调用接口,待付款订单数量、待发货订单数量、退款订单数量、退货订单数量加载到页面中 ``` <pre class="calibre14">``` <span class="token"><</span>script<span class="token">></span> $<span class="token1">(</span><span class="token2">function</span><span class="token1">(</span><span class="token1">)</span> <span class="token1">{</span> <span class="token5">//交易提示 初始化</span> $<span class="token1">.</span><span class="token3">post</span><span class="token1">(</span>SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Seller_Trade_Order&met=getOrderNum&typ=json'</span><span class="token1">,</span> <span class="token1">{</span><span class="token1">}</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span>data<span class="token1">)</span> <span class="token1">{</span> <span class="token2">if</span> <span class="token1">(</span> data<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span> <span class="token1">)</span> <span class="token1">{</span> var data <span class="token">=</span> data<span class="token1">.</span>data<span class="token1">,</span> order_num_list <span class="token">=</span> $<span class="token1">(</span><span class="token4">'#order_num_list'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">children</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span> <span class="token1">(</span> data<span class="token1">.</span>wait_pay_num <span class="token">></span> <span class="token6">0</span> <span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span>order_num_list<span class="token1">[</span><span class="token6">0</span><span class="token1">]</span><span class="token1">)</span><span class="token1">.</span><span class="token3">children</span><span class="token1">(</span><span class="token4">'a'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">addClass</span><span class="token1">(</span><span class="token4">'num bbc_border bbc_color'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">append</span><span class="token1">(</span><span class="token4">'<em class="bbc_seller_bg">'</span> <span class="token">+</span> data<span class="token1">.</span>wait_pay_num <span class="token">+</span> <span class="token4">'</em>'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">if</span> <span class="token1">(</span> data<span class="token1">.</span>payed_num <span class="token">></span> <span class="token6">0</span> <span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span>order_num_list<span class="token1">[</span><span class="token6">1</span><span class="token1">]</span><span class="token1">)</span><span class="token1">.</span><span class="token3">children</span><span class="token1">(</span><span class="token4">'a'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">addClass</span><span class="token1">(</span><span class="token4">'num bbc_border bbc_color'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">append</span><span class="token1">(</span><span class="token4">'<em class="bbc_seller_bg">'</span> <span class="token">+</span> data<span class="token1">.</span>payed_num <span class="token">+</span> <span class="token4">'</em>'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">if</span> <span class="token1">(</span> data<span class="token1">.</span>refund_num <span class="token">></span> <span class="token6">0</span> <span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span>order_num_list<span class="token1">[</span><span class="token6">2</span><span class="token1">]</span><span class="token1">)</span><span class="token1">.</span><span class="token3">children</span><span class="token1">(</span><span class="token4">'a'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">addClass</span><span class="token1">(</span><span class="token4">'num bbc_border bbc_color'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">append</span><span class="token1">(</span><span class="token4">'<em class="bbc_seller_bg">'</span> <span class="token">+</span> data<span class="token1">.</span>refund_num <span class="token">+</span> <span class="token4">'</em>'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token2">if</span> <span class="token1">(</span> data<span class="token1">.</span>return_num <span class="token">></span> <span class="token6">0</span> <span class="token1">)</span> <span class="token1">{</span> $<span class="token1">(</span>order_num_list<span class="token1">[</span><span class="token6">3</span><span class="token1">]</span><span class="token1">)</span><span class="token1">.</span><span class="token3">children</span><span class="token1">(</span><span class="token4">'a'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">addClass</span><span class="token1">(</span><span class="token4">'num bbc_border bbc_color'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">append</span><span class="token1">(</span><span class="token4">'<em class="bbc_seller_bg">'</span> <span class="token">+</span> data<span class="token1">.</span>return_num <span class="token">+</span> <span class="token4">'</em>'</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="token"><</span><span class="token">/</span>script<span class="token">></span> ``` ``` #### 2.数据获取 接口地址:index.php?ctl=Seller\_Trade\_Order&met=getOrderNum&typ=json 接口文件:\\shop\\controllers\\Seller\\Trade\\OrderCtl.php 控制器:Seller\_Trade\_OrderCtl 方法:getOrderNum() ``` <pre class="calibre15">``` <span class="token5">//待付款订单</span> $condi <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $condi<span class="token1">[</span><span class="token4">'order_status'</span><span class="token1">]</span> <span class="token">=</span> Order_StateModel<span class="token1">:</span><span class="token1">:</span>ORDER_WAIT_PAY<span class="token1">;</span> $wait <span class="token">=</span> $orderBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getPhysicalList</span><span class="token1">(</span>$condi<span class="token1">)</span><span class="token1">;</span> $wait_pay_data <span class="token">=</span> $wait<span class="token1">[</span><span class="token4">'items'</span><span class="token1">]</span><span class="token1">;</span> <span class="token5">//待发货订单</span> $condi <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $condi<span class="token1">[</span><span class="token4">'order_status:IN'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span> Order_StateModel<span class="token1">:</span><span class="token1">:</span>ORDER_PAYED<span class="token1">,</span> Order_StateModel<span class="token1">:</span><span class="token1">:</span>ORDER_WAIT_PREPARE_GOODS <span class="token1">)</span><span class="token1">;</span> $order <span class="token">=</span> $orderBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getPhysicalList</span><span class="token1">(</span>$condi<span class="token1">)</span><span class="token1">;</span> $payed_data <span class="token">=</span> $order<span class="token1">[</span><span class="token4">'items'</span><span class="token1">]</span><span class="token1">;</span> <span class="token5">//退款订单</span> $condi <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $condi<span class="token1">[</span><span class="token4">'seller_user_id'</span><span class="token1">]</span> <span class="token">=</span> Perm<span class="token1">:</span><span class="token1">:</span>$shopId<span class="token1">;</span> $condi<span class="token1">[</span><span class="token4">'return_state'</span><span class="token1">]</span> <span class="token">=</span> Order_ReturnModel<span class="token1">:</span><span class="token1">:</span>RETURN_WAIT_PASS<span class="token1">;</span> $condi<span class="token1">[</span><span class="token4">'return_type:!='</span><span class="token1">]</span> <span class="token">=</span> Order_ReturnModel<span class="token1">:</span><span class="token1">:</span>RETURN_TYPE_GOODS<span class="token1">;</span> $refund_data <span class="token">=</span> $orderReturn<span class="token">-</span><span class="token">></span><span class="token3">getByWhere</span><span class="token1">(</span>$condi<span class="token1">)</span><span class="token1">;</span> <span class="token5">//退货订单</span> $condi <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $condi<span class="token1">[</span><span class="token4">'seller_user_id'</span><span class="token1">]</span> <span class="token">=</span> Perm<span class="token1">:</span><span class="token1">:</span>$shopId<span class="token1">;</span> $condi<span class="token1">[</span><span class="token4">'return_state'</span><span class="token1">]</span> <span class="token">=</span> Order_ReturnModel<span class="token1">:</span><span class="token1">:</span>RETURN_WAIT_PASS<span class="token1">;</span> $condi<span class="token1">[</span><span class="token4">'return_type'</span><span class="token1">]</span> <span class="token">=</span> Order_ReturnModel<span class="token1">:</span><span class="token1">:</span>RETURN_TYPE_GOODS<span class="token1">;</span> $return_data <span class="token">=</span> $orderReturn<span class="token">-</span><span class="token">></span><span class="token3">getByWhere</span><span class="token1">(</span>$condi<span class="token1">)</span><span class="token1">;</span> $data<span class="token1">[</span><span class="token4">'wait_pay_num'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">count</span><span class="token1">(</span>$wait_pay_data<span class="token1">)</span><span class="token1">;</span> $data<span class="token1">[</span><span class="token4">'payed_num'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">count</span><span class="token1">(</span>$payed_data<span class="token1">)</span><span class="token1">;</span> $data<span class="token1">[</span><span class="token4">'refund_num'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">count</span><span class="token1">(</span>$refund_data<span class="token1">)</span><span class="token1">;</span> $data<span class="token1">[</span><span class="token4">'return_num'</span><span class="token1">]</span> <span class="token">=</span> <span class="token3">count</span><span class="token1">(</span>$return_data<span class="token1">)</span><span class="token1">;</span> ``` ```