wangtengyu
2018-12-07 f459412e0dac4ed94106da043b4c6f8576bfe496
commit | author | age
e2b48d 1 <?php
B 2
3 /**
4  * 确认收货
5 */
6     define('IN_ECS', true);
7     require('includes/init.php');
8     $result=array();
9     $result1=array();
10     $order_sn = isset($_REQUEST['order_sn'])  ? $_REQUEST['order_sn'] : 0;
11     $user_id = isset($_REQUEST['user_id'])  ? intval($_REQUEST['user_id']) : 0;
12     
13
14    $row = $db -> query("update ".$ecs->table('order_info')." set shipping_status = '2' where order_sn = '$order_sn' AND `user_id`='$user_id'");
15    
16     if($row){
17         $result['code']=1;
18         $result['info']='订单取消成功!';
19     }else{
20         $result['code']=0;
21         $result['info']='订单取消失败!';
22     }
23     
24     $sql="SELECT * FROM  ".$ecs->table('order_info')." WHERE order_sn='$order_sn' ";
25     
26     $res = $db -> getRow($sql);
27     
28     date_default_timezone_set('PRC');
29         $res['add_time']=date('Y-m-d h:m:s',$res['add_time']);
30         if($res['order_status']==0){
31             $res['order_status']="未确认";
32         }else if($res['order_status']==1){
33             $res['order_status']="已确认";
34         }else if($res['order_status']==2){
35             $res['order_status']="已取消";
36         }else if($res['order_status']==3){
37             $res['order_status']="无效";
38         }else if($res['order_status']==4){
39             $res['order_status']="退货";
40         }else if($res['order_status']==5){
41             $res['order_status']="已分单";
42         }
43         
44         if($res['shipping_status']==0){
45             $res['shipping_status']="未发货";
46         }else if($res['shipping_status']==1){
47             $res['shipping_status']="已发货";
48         }else if($res['shipping_status']==2){
49             $res['shipping_status']="已收货";
50         }else if($res['shipping_status']==3){
51             $res['shipping_status']="备货中";
52         }
53         
54         if($res['pay_status']==0){
55             $res['pay_status']="未付款";
56         }else if($res['pay_status']==1){
57             $res['pay_status']="付款中";
58         }else if($res['pay_status']==2){
59             $res['pay_status']="已付款";
60             
61         }
62     $result1['orderInfo']=$res;
63     $order_id=$res['order_id'];
64     $sql="SELECT goods_name, goods_price,goods_number,goods_attr
65         FROM  ".$ecs->table('order_goods')." WHERE order_id='$order_id' ";
66     //print_r($sql);
67     $res = $db -> getAll($sql);
68     $result1['orderGoods']=$res;
69     $result['info']=$result1;
70     print_r(json_encode($result));
71
72 ?>