过滤刷单账号

This commit is contained in:
jianghanbo 2024-09-01 13:38:02 +08:00
parent 1520699f88
commit ea7ad218c6
4 changed files with 72 additions and 16 deletions

View File

@ -3,8 +3,10 @@
namespace app\command; namespace app\command;
use app\admin\controller\AdminController; use app\admin\controller\AdminController;
use app\common\Error;
use app\model\Admins; use app\model\Admins;
use app\model\Blacks; use app\model\Blacks;
use app\model\FilterMobiles;
use app\model\Finances; use app\model\Finances;
use app\model\Logs; use app\model\Logs;
use app\model\Orders; use app\model\Orders;
@ -364,6 +366,9 @@ class SpiderDy extends Command
if (empty($item)) { if (empty($item)) {
$order->is_zhibo = $this->zhibo($order->product_name, $order->os); $order->is_zhibo = $this->zhibo($order->product_name, $order->os);
if (FilterMobiles::isFilterMobile($order->mobile)) {
$admin_id = 0;
} else {
$oldMobile = orders::where("os", $order->os)->where("mobile", $order->mobile) $oldMobile = orders::where("os", $order->os)->where("mobile", $order->mobile)
->where("create_time", '>=', time() - 24 * 3600 * 3)->find(); ->where("create_time", '>=', time() - 24 * 3600 * 3)->find();
@ -374,9 +379,10 @@ class SpiderDy extends Command
} }
if (empty($admin_id)) return null; if (empty($admin_id)) return null;
}
$order->admin_id = $admin_id; $order->admin_id = $admin_id;
$order->give_time = time(); $order->give_time = time();
//判断是否需要发短信 //判断是否需要发短信
if (($order->os == 1 && array_key_exists($order->order_status, [1 => 1, 3 => 3])) || if (($order->os == 1 && array_key_exists($order->order_status, [1 => 1, 3 => 3])) ||
($order->os == 2 && array_key_exists($order->order_status, [2 => 2, 3 => 3, 4 => 4])) || ($order->os == 2 && array_key_exists($order->order_status, [2 => 2, 3 => 3, 4 => 4])) ||

View File

@ -5,6 +5,7 @@ namespace app\command;
use app\admin\controller\AdminController; use app\admin\controller\AdminController;
use app\model\Admins; use app\model\Admins;
use app\model\Blacks; use app\model\Blacks;
use app\model\FilterMobiles;
use app\model\Finances; use app\model\Finances;
use app\model\Logs; use app\model\Logs;
use app\model\Orders; use app\model\Orders;
@ -387,6 +388,10 @@ class SpiderMt extends Command
if (empty($item)) { if (empty($item)) {
//$order->is_zhibo = $this->zhibo($order->product_name, $order->os); //$order->is_zhibo = $this->zhibo($order->product_name, $order->os);
// 刷单账号
if (FilterMobiles::isFilterMobile($order->mobile)) {
$admin_id = 0;
} else {
$oldMobile = orders::where("os", $order->os)->where("mobile", $order->mobile) $oldMobile = orders::where("os", $order->os)->where("mobile", $order->mobile)
->where("create_time", '>=', time() - 24 * 3600 * 3)->find(); ->where("create_time", '>=', time() - 24 * 3600 * 3)->find();
@ -397,6 +402,8 @@ class SpiderMt extends Command
} }
if (empty($admin_id)) return null; if (empty($admin_id)) return null;
}
$order->admin_id = $admin_id; $order->admin_id = $admin_id;
$order->give_time = time(); $order->give_time = time();
@ -404,8 +411,10 @@ class SpiderMt extends Command
if (($order->os == 1 && array_key_exists($order->order_status, [1 => 1, 3 => 3])) || if (($order->os == 1 && array_key_exists($order->order_status, [1 => 1, 3 => 3])) ||
($order->os == 2 && array_key_exists($order->order_status, [2 => 2, 3 => 3, 4 => 4])) || ($order->os == 2 && array_key_exists($order->order_status, [2 => 2, 3 => 3, 4 => 4])) ||
($order->os == 3 && $order->order_status == 1)) { ($order->os == 3 && $order->order_status == 1)) {
if ($admin_id > 0) {
$this->sms($admin_id, $order); $this->sms($admin_id, $order);
} }
}
//新获得一个用户的,提示管理员有新的订单 //新获得一个用户的,提示管理员有新的订单
Redis::incrBy('CRM:USER:ONLINE:NEW:' . $admin_id, 1); Redis::incrBy('CRM:USER:ONLINE:NEW:' . $admin_id, 1);
$item = new Orders(); $item = new Orders();

View File

@ -0,0 +1,36 @@
<?php
namespace app\model;
use app\common\Keys;
use support\Redis;
class FilterMobiles extends base
{
/**
* @param string $mobile
* @param bool $refresh
* @return bool
* @throws \think\db\exception\BindParamException
*/
public static function isFilterMobile(string $mobile, bool $refresh = false): bool
{
$key = 'order_filter_mobiles';
if ($refresh || !Redis::exists($key)) {
$list = self::query()->column('id', 'mobile');
if (!empty($list)) {
$chunks = array_chunk($list, 50, true);
foreach($chunks as $mobiles) {
Redis::hMSet($key, $mobiles);
}
Redis::expire($key, 60*60*24);
}
}
return Redis::hExists($key, $mobile);
}
}

View File

@ -4,6 +4,7 @@ namespace app\server;
use app\common\Error; use app\common\Error;
use app\model\Admins as AdminsModel; use app\model\Admins as AdminsModel;
use app\model\FilterMobiles;
use app\model\Finances as FinancesModel; use app\model\Finances as FinancesModel;
use app\model\Orders as OrdersModel; use app\model\Orders as OrdersModel;
use support\Log; use support\Log;
@ -50,6 +51,10 @@ class Orders {
$result[$order->sn] = Error::undefined('client mobile or admin mobile invalid'); $result[$order->sn] = Error::undefined('client mobile or admin mobile invalid');
continue; continue;
} }
if (FilterMobiles::isFilterMobile($order->mobile)) {
$result[$order->sn] = Error::undefined('刷单账单');
continue;
}
$admin_mobile = $admin_mobile['mobile'] ?? ''; $admin_mobile = $admin_mobile['mobile'] ?? '';
if (Blacks::CExists($order->mobile)) { if (Blacks::CExists($order->mobile)) {