企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
#### 1.视图展示 文件路径:\shop\views\default\Seller\IndexCtl\index.php ~~~ <div class="m white-panel"> <div class="pannel_div"> <div class="mt"> <h3 class="bbc_seller_border"><?=__('交易提示')?></h3> <h5><?=__('您需要立即处理的交易订单')?></h5> </div> <div class="mc"> <div class="focus"> <span><?=__('近期售出')?>: <a href="./index.php?ctl=Seller_Trade_Order&met=physical&typ=e&"><?=__('交易中的订单')?></a></span> <span><?=__('维权提示')?>: <a href="./index.php?ctl=Seller_Service_Complain&met=index&typ=e&"><?=__('收到维权投诉')?>&nbsp;<?= $complain_unsolved_count ? $complain_unsolved_count : 0 ?> / <?= $complain_all_count ? $complain_all_count : 0?></a></span> </div> <ul id="order_num_list"> <li><a href="./index.php?ctl=Seller_Trade_Order&met=getPhysicalNew&typ=e"><?=__('待付款订单')?></a></li> <li><a href="./index.php?ctl=Seller_Trade_Deliver&met=deliver&typ=e"><?=__('待发货订单')?></a></li> <li><a href="./index.php?ctl=Seller_Service_Return&met=orderReturn&typ=e" class=""><?=__('退款订单')?></a></li> <li><a href="./index.php?ctl=Seller_Service_Return&met=goodsReturn&typ=e" class=""><?=__('退货订单')?></a></li> </ul> </div> </div> </div> ~~~ jq中调用接口,待付款订单数量、待发货订单数量、退款订单数量、退货订单数量加载到页面中 ~~~ <script> $(function() { //交易提示 初始化 $.post(SITE_URL + '?ctl=Seller_Trade_Order&met=getOrderNum&typ=json', {}, function (data) { if ( data.status == 200 ) { var data = data.data, order_num_list = $('#order_num_list').children(); if ( data.wait_pay_num > 0 ) { $(order_num_list[0]).children('a').addClass('num bbc_border bbc_color').append('<em class="bbc_seller_bg">' + data.wait_pay_num + '</em>'); } if ( data.payed_num > 0 ) { $(order_num_list[1]).children('a').addClass('num bbc_border bbc_color').append('<em class="bbc_seller_bg">' + data.payed_num + '</em>'); } if ( data.refund_num > 0 ) { $(order_num_list[2]).children('a').addClass('num bbc_border bbc_color').append('<em class="bbc_seller_bg">' + data.refund_num + '</em>'); } if ( data.return_num > 0 ) { $(order_num_list[3]).children('a').addClass('num bbc_border bbc_color').append('<em class="bbc_seller_bg">' + data.return_num + '</em>'); } } }) }) </script> ~~~ #### 2.数据获取 接口地址:index.php?ctl=Seller_Trade_Order&met=getOrderNum&typ=json 接口文件:\shop\controllers\Seller\Trade\OrderCtl.php 控制器:Seller_Trade_OrderCtl 方法:getOrderNum() ~~~ //待付款订单 $condi = array(); $condi['order_status'] = Order_StateModel::ORDER_WAIT_PAY; $wait = $orderBaseModel->getPhysicalList($condi); $wait_pay_data = $wait['items']; //待发货订单 $condi = array(); $condi['order_status:IN'] = array( Order_StateModel::ORDER_PAYED, Order_StateModel::ORDER_WAIT_PREPARE_GOODS ); $order = $orderBaseModel->getPhysicalList($condi); $payed_data = $order['items']; //退款订单 $condi = array(); $condi['seller_user_id'] = Perm::$shopId; $condi['return_state'] = Order_ReturnModel::RETURN_WAIT_PASS; $condi['return_type:!='] = Order_ReturnModel::RETURN_TYPE_GOODS; $refund_data = $orderReturn->getByWhere($condi); //退货订单 $condi = array(); $condi['seller_user_id'] = Perm::$shopId; $condi['return_state'] = Order_ReturnModel::RETURN_WAIT_PASS; $condi['return_type'] = Order_ReturnModel::RETURN_TYPE_GOODS; $return_data = $orderReturn->getByWhere($condi); $data['wait_pay_num'] = count($wait_pay_data); $data['payed_num'] = count($payed_data); $data['refund_num'] = count($refund_data); $data['return_num'] = count($return_data); ~~~