|
@@ -32,13 +32,14 @@ class Spider
|
|
|
}
|
|
|
|
|
|
# 从采集的数据导入 一天采集一次,一次使用12个
|
|
|
- public function import()
|
|
|
+ public function import_api()
|
|
|
{
|
|
|
# 导入到唯美中
|
|
|
# 每年12期,
|
|
|
$id = Dever::input('info_id', 5);
|
|
|
$source_id = $where['pid'] = Dever::input('pid', 3);
|
|
|
$where['use'] = 1;
|
|
|
+ $where['limit'] = '0,15';
|
|
|
$data = Dever::db('spider/data')->getAll($where);
|
|
|
|
|
|
$main_name = '收集者';
|
|
@@ -55,11 +56,11 @@ class Spider
|
|
|
foreach ($data as $k => $v) {
|
|
|
$value = Dever::array_decode($v['value']);
|
|
|
if ($value && is_array($value)) {
|
|
|
- Dever::db('spider/data')->update(array('where_id' => $v['id'], 'use' => 2));
|
|
|
+ //Dever::db('spider/data')->update(array('where_id' => $v['id'], 'use' => 2));
|
|
|
foreach ($value as $k1 => $v1) {
|
|
|
$page_desc = $v1['name'];
|
|
|
$pic = $v1['pic'];
|
|
|
- $this->upPic($id, $source_id, $main_name, $page_name, $page_desc, $pic, $param);
|
|
|
+ $this->upPic($id, $source_id, $date, $main_name, $page_name, $page_desc, $pic, $param);
|
|
|
|
|
|
}
|
|
|
}
|
|
@@ -102,10 +103,10 @@ class Spider
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $this->upPic($id, $source_id, $main_name, $page_name, $page_desc, $pic, $data, $day_name_type);
|
|
|
+ $this->upPic($id, $source_id, $date, $main_name, $page_name, $page_desc, $pic, $data, $day_name_type);
|
|
|
}
|
|
|
|
|
|
- public function upPic($id, $source_id, $main_name, $page_name, $page_desc, $pic, $data, $day_name_type = 1)
|
|
|
+ public function upPic($id, $source_id, $date, $main_name, $page_name, $page_desc, $pic, $data, $day_name_type = 1)
|
|
|
{
|
|
|
if (isset($date[0]) && isset($date[1]) && isset($date[2])) {
|
|
|
$year = intval($date[0]);
|