Client.php
1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Created by JetBrains PhpStorm.
* User: elkan
* Date: 14-8-5
* Time: 下午6:04
* To change this template use File | Settings | File Templates.
*/
class YHMOrders_Models_Delivery_Client
{
/**
*
* @var YHMOrders_Models_Delivery_Dao
*/
private static $dao;
/**
*
* @return YHMOrders_Models_Delivery_Dao
*/
static private function dao()
{
if (empty(self::$dao)) {
self::$dao = new YHMOrders_Models_Delivery_Dao();
}
return self::$dao;
}
/**
* 查询订单收货地址
* @param int $order_code
* @return int
*/
static function getOneByOrderCode($order_code)
{
if ((int)$order_code < 1) {
return 0;
}
return self::dao()->getOneByOrderCode((int)$order_code);
}
/**
* 存储订单送货地址
* @param $orderCode
* @param $receiverName
* @param $receiverMobile
* @param $areaCode
* @param $address
* @param $zipCode
* @return int
*/
static function addDelivery($orderCode, $receiverName, $receiverMobile, $areaCode, $address, $zipCode)
{
return self::dao()->addDelivery($orderCode, $receiverName, $receiverMobile, $areaCode, $address, $zipCode);
}
/**
* 插入发货信息
* @param type $deliver_company_id
* @param type $deliver_company_name
* @param type $delivery_code
* @return type
*/
static function setDelivery($order_code,$deliver_company_id,$deliver_company_name,$delivery_code){
return self::dao()->setDelivery($order_code,$deliver_company_id,$deliver_company_name,$delivery_code);
}
}