Star.class.php
2.97 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/**
* 品牌信息
*
* @name Service_Star
* @version 1.0 (2013-6-5)
* @package Service/Star
* @author hbomb
* @since 1.0
*/
class Service_Star extends Lib_Service
{
const ROUTER = 'star.yohood.star';
/**
* 获取明星
*
* @param unknown_type $offset
* @param unknown_type $limit
* @param unknown_type $status
* @return Ambigous <multitype:, Util_Dao_Db_PdoQuery>
*/
public function getStarByState ($offset, $limit, $state)
{
return self::service(self::ROUTER)->cache(false)->
fetchAssoc('getStarByState', array('offset' => $offset, 'limit' => $limit, 'state'=>$state));
}
/**
* 根据状态获取所有明星个数. 用于前端分页
*
* @param $status
*/
public function getStarTotal ($state)
{
return self::service(self::ROUTER)->cache(false)->fetchOne('getStarTotal', array('state'=>$state));
}
/**
* 根据id更新明星状态. 用于管理员更新一个明星的操作.
* @param unknown_type $name
* @param unknown_type $pics
* @param unknown_type $description
* @param unknown_type $state
* @param unknown_type $brand_id
* @param unknown_type $seq
* @param unknown_type $news_ids
* @param unknown_type $id
*/
public function updateStar ($name,$pics,$description,$state,$brand_id,$seq,$news_ids,$say,$id)
{
$param = array(
'id'=>$id,
'name'=> $name,
'description'=>$description,
'state'=>$state,
'pics'=>$pics,
'brand_id'=>$brand_id,
'seq'=>$seq,
'news_ids'=>$news_ids,
'say'=>$say
);
$status = self::service(self::ROUTER)->cache(false)->update('updateStar', $param)->status();
return $status;
}
/**
* 用户提交明星.
* @param unknown_type $name
* @param unknown_type $logo
* @param unknown_type $description
* @param unknown_type $pics
* @param unknown_type $person
* @param unknown_type $news_ids
* @param unknown_type $seq
* @param unknown_type $state
* @return number
*/
public function submitStar ($name,$pics,$description,$state,$brand_id,$seq,$news_ids,$say)
{
$param = array(
'name'=> $name,
'description'=>$description,
'state'=>$state,
'pics'=>$pics,
'brand_id'=>$brand_id,
'seq'=>$seq,
'news_ids'=>$news_ids,
'say'=>$say
);
$status = self::service(self::ROUTER)->cache(false)->insert('insertStar', $param)->lastInsertId();
return $status;
}
/**
* 根据ID获取主理人
* @param unknown_type $id
*/
public static function getStarByID($id)
{
return self::service(self::ROUTER)->cache(false)->fetchRow('getStarByID', array('id'=>$id));
}
}