Client.php
1.24 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
<?php
class YHMOrders_Models_Cart_Client {
/**
*
* @var YHMOrders_Models_Cart_Dao
*/
private static $dao;
/**
*
* @return YHMOrders_Models_Cart_Dao
*/
static private function dao() {
if (empty(self::$dao)) {
self::$dao = new YHMOrders_Models_Cart_Dao();
}
return self::$dao;
}
/**
*
* @param int $uid
* @param int $product_sku
* @param float $last_price
* @return int
*/
public static function getDetailByUid($uid,$product_sku,$last_price)
{
if(empty($uid) || empty($product_sku) || empty($last_price))
{
return 0;
}
return self::dao()->getDetailByUid($uid, $product_sku, $last_price);
}
/**
*
* @param array $params
* @return number
*/
public static function setGoodsByUid($params)
{
if(empty($params))
{
return 0;
}
return self::dao()->setGoodsByUid($params);
}
/**
* 更新购物车
* @param int $uid
* @param int $product_sku
* @param deciaml $last_price
* @param number $buy_number
*/
public static function updateGoodsByNum($uid,$product_sku,$last_price,$buy_number=1)
{
if(empty($uid) || empty($product_sku) || empty($last_price) || empty($buy_number)) return 0;
return self::dao()->updateGoodsByNum($uid, $product_sku, $last_price);
}
}