ecshop /user.php?act=order_list,ecshop会员中心增加订单搜索功能

在user.php中的act=order_list中增加以下程序。

$order_sn = isset($_REQUEST['order_sn'])?$_REQUEST['order_sn']:'';

$consignee = isset($_REQUEST['consignee'])?$_REQUEST['consignee']:'';

$start_date = isset($_REQUEST['start_date'])?$_REQUEST['start_date']:'';

$end_date = isset($_REQUEST['end_date'])?$_REQUEST['end_date']:'';

$pay_status = isset($_REQUEST['pay_status'])?$_REQUEST['pay_status']:'';

$shipping_status = isset($_REQUEST['shipping_status'])?$_REQUEST['shipping_status']:'';

$order_status = isset($_REQUEST['order_status'])?$_REQUEST['order_status']:'';

$where ="";

if($order_sn){

$where.=" and order_sn ='$order_sn'";

}

if($consignee){

$where.=" and consignee = '$$consignee'";

}

if($start_date){

$t = strtotime($start_date);

$where.=" and add_time >= $t";

}

if($end_date){

$t = strtotime($end_date);

$where.="  and add_time <= $t";

}

if($pay_status && $pay_status!= '-1'){

$where.=" pay_status = '$pay_status'";

}

if($shipping_status && $shipping_status!= '-1'){

$where.=" and shipping_status = '$shipping_status'";

}

if($order_status && $order_status!= '-1'){

$where.=" and order_status = '$order_status'";

}

$record_count = $db->getOne("SELECT COUNT(*) FROM " .$ecs->table('order_info'). " WHERE user_id = '$user_id' $where");

$pager  = get_pager('user.php', array('act' => $action,'order_status'=>$order_status,'order_sn'=>$order_sn,'consignee'=>$consignee,'start_date'=>$start_date,'end_date'=>$end_date,'pay_status'=>$pay_status,'shipping_status'=>$shipping_status), $record_count, $page);

$orders = get_user_orders($user_id, $pager['size'], $pager['start']);

$merge  = get_user_merge($user_id);

$smarty->assign('os_list', get_status_list('order'));

$smarty->assign('ps_list', get_status_list('payment'));

$smarty->assign('ss_list', get_status_list('shipping'));

$smarty->assign('merge',  $merge);

$smarty->assign('pager',  $pager);

$smarty->assign('orders', $orders);

$smarty->display('user_transaction.dwt');

在分页模板中,传递要查询的参数。

2:模板中增加以下程序。用于搜索表单

订单编号  

收货人姓名

下单时间   

 -

订单状态:

请选择

{html_options options=$os_list selected=-1}

付款状态:      

请选择

{html_options options=$ps_list selected=-1}

发货状态:       

请选择

{html_options options=$ss_list selected=-1}

3:将以下搜索条件加到搜索函数中去。在includes/lib_transaction.php中

$order_sn = isset($_REQUEST['order_sn'])?$_REQUEST['order_sn']:'';

$consignee = isset($_REQUEST['consignee'])?$_REQUEST['consignee']:'';

$start_date = isset($_REQUEST['start_date'])?$_REQUEST['start_date']:'';

$end_date = isset($_REQUEST['end_date'])?$_REQUEST['end_date']:'';

$pay_status = isset($_REQUEST['pay_status'])?$_REQUEST['pay_status']:'';

$shipping_status = isset($_REQUEST['shipping_status'])?$_REQUEST['shipping_status']:'';

$order_status = isset($_REQUEST['order_status'])?$_REQUEST['order_status']:'';

$where ="";

if($order_sn){

$where.=" and order_sn ='$order_sn'";

}

if($consignee){

$where.=" and consignee = '$$consignee'";

}

if($start_date){

$t = strtotime($start_date);

$where.=" and add_time >= $t";

}

if($end_date){

$t = strtotime($end_date);

$where.="  and add_time <= $t";

}

if($pay_status && $pay_status!= '-1'){

$where.=" pay_status = '$pay_status'";

}

if($shipping_status && $shipping_status!= '-1'){

$where.=" and shipping_status = '$shipping_status'";

}

if($order_status && $order_status!= '-1'){

$where.=" and order_status = '$order_status'";

}

以上步骤,就完成了

相关文章:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。 经导师精心指导并认可、获 98 分的毕业设计项目!【项目资源】:微信小程序。【项目说明】:聚焦计算机相关专业毕设及实战操练,可作课程设计与期末大作业,含全部源码,能直用于毕设,经严格调试,运行有保障!【项目服务】:有任何使用上的问题,欢迎随时与博主沟通,博主会及时解答。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值