|
|
@@ -14,24 +14,25 @@ class MerchantAssetClass extends BaseClass
|
|
|
public static $baseFile = '\biz\merchant\models\MerchantAsset';
|
|
|
|
|
|
//增加客户数和粉丝数 shish 2019.9.7
|
|
|
- public static function addUser($merchantId, $subscribe)
|
|
|
+ public static function addUser($merchantId, $subscribe, $add = false)
|
|
|
{
|
|
|
$asset = self::getByMerchantId($merchantId, true);
|
|
|
if ($subscribe == 1) {
|
|
|
- $asset->totalUser += 1;
|
|
|
+ if ($add) {
|
|
|
+ $asset->totalUser += 1;
|
|
|
+ }
|
|
|
$asset->totalFans += 1;
|
|
|
} else {
|
|
|
$asset->totalUser += 1;
|
|
|
}
|
|
|
$asset->save();
|
|
|
-
|
|
|
//每天客户增加
|
|
|
- StatUserClass::increase($merchantId, $asset, $subscribe);
|
|
|
+ StatUserClass::increase($merchantId, $asset, $subscribe, $add);
|
|
|
//每月客户增加
|
|
|
- StatUserMonthClass::increase($merchantId, $asset, $subscribe);
|
|
|
+ StatUserMonthClass::increase($merchantId, $asset, $subscribe, $add);
|
|
|
}
|
|
|
-
|
|
|
- //取消关注,减少粉丝数 shish 2019.9.7
|
|
|
+
|
|
|
+ //取消关注减少粉丝数 shish 2019.9.7
|
|
|
public static function reduceFans($merchantId)
|
|
|
{
|
|
|
$asset = self::getByMerchantId($merchantId, true);
|