Onlinereg.class.php
7.51 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<?php
class Service_Onlinereg extends Lib_Service
{
const ROUTER = 'onlinereg.yohood.onlinereg';
private static $_seller_tag = 'tag_yohood_seller_';
private static $_seller_key = 'key_yohood_seller_';
private static $_download_tag = 'tag_yohood_download_';
private static $_download_key = 'key_yohood_download_';
/**
* 设置商家信息
*
* @param string $name
* @param string $type
* @param string $sex
* @param int $brand_reg_type
* @param int $is_enter_yohobuy
* @param int $profession
* @param string $product_type
* @param string $country
* @param string $city
* @param string $company
* @param string $contact
* @param string $telphone
* @param string $mobile
* @param string $email
* @param string $relation
* @param string $website
* @param string $introduction
* @param int $is_3c
* @param string $place
* @param string $files
* @param string $zipcode
* @return int
*/
public function setSellerInfo($name, $type, $sex, $brand_reg_type, $is_enter_yohobuy, $profession, $product_type, $country, $city,
$company, $contact, $telphone, $mobile, $email, $relation, $website, $introduction, $is_3c, $place, $files, $zipcode)
{
$params = array(
'name' => $name, 'type' => intval($type),'brand_reg_type'=> intval($brand_reg_type), 'is_enter_yohobuy'=> intval($is_enter_yohobuy),
'product_type'=> $product_type,'company'=> addslashes($company),'contact'=> $contact,'telphone' => $telphone,'email'=> $email,
'country'=>$country,'relation'=> intval($relation),'website' => $website,'is_3c'=> intval($is_3c), 'place' => addslashes($place),
'files'=> $files, 'profession' => addslashes($profession),'sex'=> $sex,'introduction'=> addslashes($introduction),'city'=> $city,
'mobile' =>addslashes($mobile),'zipcode' => $zipcode
);
return self::service(self::ROUTER)->tag(self::$_seller_tag)->insert('setSellerInfo', $params)->lastInsertId();
}
/**
* 根据type获取商家列表
*
* @param int $type
* @param int $offset
* @param int $limit
* @return array
*/
public function getSellerListByType($type, $offset, $limit)
{
$params = array('type' => intval($type),'offset' => intval($offset), 'limit' => intval($limit));
$key = sprintf("%s_%s_%s_%s", self::$_seller_key, $type, $offset, $limit);
return self::service(self::ROUTER)->tag(self::$_seller_tag)->key($key)->fetchAssoc('getSellerListByType', $params);
}
/**
* 根据type获取总数
*
* @param int $type
* @return array
*/
public function getSellerTotalByType($type)
{
$params = array('type' => intval($type));
return self::service(self::ROUTER)->cache(false)->fetchOne('getSellerTotalByType', $params);
}
/**
* 根据ID获取商家
*
* @param int $id
* @return array
*/
public function getSellerById($id)
{
$params = array('id'=> $id);
$key = self::$_seller_key . $id;
return self::service(self::ROUTER)->tag(self::$_seller_tag)->key($key)->fetchRow('getSellerById', $params);
}
/**
* 设置媒体信息
*
* @param string $name
* @param int $type
* @param string $profession
* @param int $sex
* @param string $company
* @param string $introduction
* @param string $website
* @param string $city
* @param string $email
* @param string $mobile
* @param string $telphone
* @param string $address
* @param string $zipcode
* @return int
*/
public function setMediaInfo($name, $type, $profession, $sex, $company, $introduction, $website, $city,
$email, $mobile, $telphone, $address, $zipcode)
{
$params = array(
'name' => addslashes($name),'type'=>$type, 'profession' => addslashes($profession),'sex'=> $sex, 'company'=> addslashes($company),
'introduction'=> addslashes($introduction),'website' => $website,'city'=> $city,
'email'=> addslashes($email),'mobile' =>addslashes($mobile), 'telphone'=> $telphone,'address' => addslashes($address),
'zipcode' => $zipcode);
return self::service(self::ROUTER)->tag(self::$_seller_tag)->insert('setMediaInfo', $params)->status();
}
/**
* 设置下载信息
*
* @param string $title
* @param string $cover
* @param string $file
* @param string $source
* @param string $source_link
* @param string $type
* @return boolean
*/
public function setDownloadInfo($title, $cover, $file, $source, $source_link, $type)
{
$params = array('title'=> addslashes($title), 'cover' => $cover, 'file'=> $file, 'source' => addslashes($source),
'source_link' => addslashes($source_link), 'type' => intval($type));
return self::service(self::ROUTER)->tag(self::$_download_tag)->insert('setDownloadInfo', $params)->status();
}
/**
* 根据ID设置下载信息
*
* @param int $id
* @param string $title
* @param string $cover
* @param string $file
* @param string $source
* @param string $source_link
* @return boolean
*/
public function setDownloadInfoById($id, $title, $cover, $file, $source, $source_link)
{
$params = array('title'=> addslashes($title), 'cover' => $cover, 'file'=> $file, 'source' => addslashes($source),
'source_link' => addslashes($source_link),'id'=> intval($id));
return self::service(self::ROUTER)->tag(self::$_download_tag)->update('setDownloadInfoById', $params)->status();
}
/**
* 获取下载列表
*
* @param int $type
* @param int $offset
* @param int $limit
* @return array
*/
public function getDownloadListByType($type, $offset, $limit)
{
$params = array('type' => intval($type),'offset' => intval($offset), 'limit' => intval($limit));
$key = sprintf("%s_%s_%s_%s", self::$_download_key, $type, $offset, $limit);
return self::service(self::ROUTER)->tag(self::$_download_tag)->fetchAssoc('getDownloadListByType', $params);
}
/**
* 获取下载总数
*
* @param int $type
* @return array
*/
public function getDownloadTotalByType($type)
{
$params = array('type' => intval($type));
return self::service(self::ROUTER)->tag(self::$_download_tag)->fetchOne('getDownloadTotalByType', $params);
}
/**
* 获取下载信息
*
* @param int $id
* @return array
*/
public function getDownloadById($id)
{
$params = array('id' => intval($id));
return self::service(self::ROUTER)->tag(self::$_download_tag)->fetchRow('getDownloadById', $params);
}
/**
* 删除下载信息
*
* @param int $id
* @return boolean
*/
public function delDownload($id)
{
$params = array('id' => intval($id));
return self::service(self::ROUTER)->tag(self::$_download_tag)->delete('delDownload', $params);
}
/**
* 设置商家信息
*
* @param array $data
* @return boolean
*/
public function setSeller(array $data)
{
$up = Util_Utils_SqlString::mergeSqlUpstring($data);
$replaces = array('up' => $up);
return self::service(self::ROUTER)->tag(self::$_seller_tag)->update('setSeller', $data, $replaces)->status();
}
}
?>