私域操盘手 - 调整账号权重计算规则,引入 WechatCustomer
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace AccountWeight\UnitWeight;
|
||||
|
||||
use app\common\model\WechatCustomer as WechatCustomerModel;
|
||||
use library\interfaces\WechatAccountWeightResultSet as WechatAccountWeightResultSetInterface;
|
||||
|
||||
class ActivityWeigth implements WechatAccountWeightResultSetInterface
|
||||
@@ -16,7 +17,15 @@ class ActivityWeigth implements WechatAccountWeightResultSetInterface
|
||||
*/
|
||||
private function getChatTimesPerDay(string $wechatId): int
|
||||
{
|
||||
return mt_rand(0, 100);
|
||||
$activity = (string)WechatCustomerModel::where([
|
||||
'wechatId' => $wechatId,
|
||||
]
|
||||
)
|
||||
->value('activity');
|
||||
|
||||
$activity = json_decode($activity, true);
|
||||
|
||||
return $activity->yesterdayMsgCount ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user