🐞 fix(command): 修改抖音订单筛选逻辑

抖音订单筛选使用 keywords 进行筛选,目前只有泰国和西藏会被拉取
This commit is contained in:
liuyuhang 2024-07-15 13:44:21 +08:00
parent d554661485
commit 688aafe9ce
1 changed files with 16 additions and 1 deletions

View File

@ -18,6 +18,7 @@ class Douyin
private $token = '';
private $gate = 'https://life.douyin.com';
public $totalPage = 10;
private $keywords = ['泰国', '西藏'];
public function __construct()
{
@ -200,7 +201,21 @@ class Douyin
}
//if(mb_strrpos($item->product_name, "S") === false) continue; G 达人 S 自己
if (!(mb_strrpos($item->product_name, "S") || mb_strrpos($item->product_name, "G") || mb_strrpos($item->product_name, ""))) continue;
// if (!(mb_strrpos($item->product_name, "S") || mb_strrpos($item->product_name, "G") || mb_strrpos($item->product_name, "甄"))) continue;
$kw_match = false;
foreach ($this->keywords as $kw) {
if (mb_strpos($item->product_name, $kw) !== false) {
$kw_match = true;
break;
}
}
if (!$kw_match) {
printf("skip order: %s %s\n", $item->sn, $item->product_name);
continue;
}
$_list[] = $item;
}