Browse Source

增加exists_update

master
李可松 4 years ago
parent
commit
1fc01b4060
  1. 4
      app/Console/Commands/Collector.php

4
app/Console/Commands/Collector.php

@ -118,6 +118,10 @@ class Collector extends Command
if (!preg_match('/\/(\d+)\.html/', $url, $match)) continue;
$id = $match[1];
if ($this->exists_update == false && CollectProduct::where(['unique_id' => $id, 'site' => 1])->exists()) {
continue;
}
$inc_sales = $http->post('https://m.mafengwo.cn/poi/poi/inc_sales', ['poiid' => $id]);
preg_match('#<strong><em>¥</em>(\d+)</strong>#', $inc_sales['html'] ?? '', $match_price);

Loading…
Cancel
Save