Client.php
1.38 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
70
<?php
/**
* 商品统计相关
*/
class YHMProduct_Models_GoodsCount_Client {
/**
*
* @var YHMProduct_Models_GoodsCount_Dao
*/
private static $dao;
/**
*
* @return YHMProduct_Models_Goodsimages_Dao
*/
private static function dao()
{
if (empty(self::$dao)) {
self::$dao = new YHMProduct_Models_GoodsCount_Dao();
}
return self::$dao;
}
/**
* 设置商品相关总数
*
* @param int $product_skc
* @param int $hot_number
* @param int $favorite_num
* @param boolean $is_sysc_search
* @return boolean
*/
public static function setGoodsCount($product_skc, $hot_number = 0, $favorite_num = 0, $is_sysc_search = true)
{
$status = self::dao()->setGoodsCount($product_skc, $hot_number, $favorite_num);
if($status && $is_sysc_search && $hot_number)
{
$syncParams = array(
'product_skc' => $product_skc,
'hot_number' => 1,
'last_update_time' => time()
);
$syncProduct = new YHMSearch_Syncgoods ();
$syncProduct->sync($syncParams);
}
return $status;
}
/**
* 获取商品总数
*
* @param int $product_skc
* @return array
*/
public static function getGoodsCount($product_skc)
{
return self::dao()->getGoodsCount($product_skc);
}
/**
* 获取商品总数列表
*
* @param array|int $skcs
* @return array
*/
public static function getGoodsCountList($skcs)
{
return self::dao()->getGoodsCountList($skcs);
}
}