CREATE TABLE `ecs_shipping_status` (
`id` INT( 5 ) NOT NULL,
`shipping_status` VARCHAR( 10 ) NOT NULL ,
PRIMARY KEY ( `id` )
) ENGINE = MYISAM ;
INSERT INTO `ecs_shipping_status`
(`id` ,`shipping_status`)
VALUES (
'0', '未發貨'
'1', '已發貨'
'2', '已取消'
'3', '備貨中'
'4', '已發貨(部分商品)'
);
以上代碼是添加一個發貨狀態表,並將對應的狀態添加入表中。
TRUNCATE TABLE `table_name`刪除表單,建議先在本地數據庫調試好,再進行網絡修正。
?$sql = 'SELECT o.order_sn, o.invoice_no,o.consignee,st.shipping_status, s.shipping_code FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS o' .
' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping') . ' AS s ON s.shipping_id = o.shipping_id' .
' LEFT JOIN ' . $GLOBALS['ecs']->table('shipping_status') . ' AS st ON st.id = o.shipping_status' .
" WHERE o.invoice_no > ''AND shipping_status = " . SS_SHIPPED .
ORDER BY shipping_time DESC LIMIT 10";
以上代碼是修正index.php中涉及sql代碼,
之後再前台需要地方調用,如:
?<marquee scrollamount='1' scrolldelay='3' direction= 'UP' width="98%" height="40">
<!-- 發貨單查詢{foreach from=$invoice_list item=invoice} -->
{$invoice.order_sn} {$invoice.consignee} {$invoice.shipping_status|truncate:3:"...":true}
<div class="blank"></div>
<!-- 結束發貨單查詢{/foreach}-->
</marquee>
獲取收件人,訂單號以及訂單狀態。
?其中<marquee scrollamount='1' scrolldelay='3' direction= 'UP' width="98%" height="40"/>內容向上滾動,<BR>$all[$key]['consignee']=sub_str($row['consignee'], 1, false).'**';獲取的名稱只顯示姓,<BR>名用**代替。
*