rabin 2 years ago
parent
commit
f03fe7848c
1 changed files with 7 additions and 2 deletions
  1. 7 2
      service/agent/lib/Import.php

+ 7 - 2
service/agent/lib/Import.php

@@ -736,14 +736,19 @@ class Import
         # 获取已审核通过、权益已发放的用户
 
         # 团队业绩
-        $data = $this->db->fetchAll('select * from ims_ewei_shop_member where status = 1 and  prestatus = 1 and isagent = 1 and allcommission > 0 order by id asc ');
+        $data = $this->db->fetchAll('select a.*,b.credit3 as bcredit3 from ims_ewei_shop_member as a left join ims_mc_members as b on b.uid = a.uid where a.status = 1 and a.prestatus = 1 and a.isagent = 1 and (b.credit3 > 0 || a.credit3 > 0) order by a.id asc ');
 
         if (!$data) {
             return false;
         }
 
         foreach ($data as $k => $v) {
-            $this->cash_log($v['id'], 2, $v['allcommission']);
+            if ($v['bcredit3'] > 0) {
+                $num = $v['bcredit3'];
+            } else {
+                $num = $v['credit3'];
+            }
+            $this->cash_log($v['id'], 1, $num);
             echo $v['id'];
             echo "\r\n";
         }