Преглед на файлове

用户注销过,再次进行推荐不送推广佣金

evoxwht преди 2 години
родител
ревизия
5a91e71842
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  1. 11 0
      crmeb/app/services/user/UserServices.php

+ 11 - 0
crmeb/app/services/user/UserServices.php

@@ -2041,6 +2041,17 @@ class UserServices extends BaseServices
         if (!$userInfo) {
             return false;
         }
+
+        //根据手机号码查询此用户注销过,不反推广佣金
+        if ($userInfo['phone'] != '' && $this->dao->getCount(['phone' => $userInfo['phone'], 'is_del' => 1])) {
+            return false;
+        }
+        //根据openid查询此用户注销过,不反推广佣金
+        $openidArray = app()->make(WechatUserServices::class)->getColumn(['uid' => $uid], 'openid', 'id');
+        if ($this->dao->getCount([['openid', 'in', $openidArray], ['is_del', '=', 1]])) {
+            return false;
+        }
+
         if (!$spread_user) {
             $spread_user = $this->dao->getOne(['uid' => $spread_uid, 'status' => 1]);
         }