Your Name %!s(int64=2) %!d(string=hai) anos
pai
achega
1ae9e22b5f
Modificáronse 2 ficheiros con 12 adicións e 3 borrados
  1. 1 1
      app/shop/database/info.php
  2. 11 2
      service/bill/lib/Cron.php

+ 1 - 1
app/shop/database/info.php

@@ -869,7 +869,7 @@ return array
             ),
             'type' => 'all',
             'order' => array('reorder' => 'desc', 'id' => 'desc'),
-            'col' => 'id,id as value, name',
+            'col' => 'id,id as value, name,agent_mid',
         ),
 
         'getAllByType' => array

+ 11 - 2
service/bill/lib/Cron.php

@@ -601,6 +601,17 @@ class Cron
         $start = Dever::maketime($start_time);
         $end = Dever::maketime($end_time);
         $shops = Dever::db('shop/info')->getguiAll(array('type'=>2));
+        if ($shops) {
+            $shop_data = array();
+            foreach ($shops as $k => $v) {
+                if ($v['agent_mid'] <1) {
+                    $shop_data[$v['id']] = $v['name'];
+                }
+            }
+            if ($shop_data) {
+                Dever::alert('以下门店没有绑定代理商:' . implode(',', $shop_data));
+            }
+        }
         foreach ($shops as $k => $v) {
             #业绩补贴:除了创V0.02,创V>=10个0.05,创V>=20个0.08
             // $subsidy = 0;
@@ -746,14 +757,12 @@ class Cron
                 $insert['dl_subsidy'] = 0;
                 $insert['v_subsidy'] = 0;
                 $res = Dever::db('bill/shop_stat')->find(array('month'=>$insert['month'],'shop_id'=>$v['id']));
-                // print_R($res);die;
                 if ($res) {
                     $insert['where_id'] = $res['id'];
                     Dever::db('bill/shop_stat')->update($insert);
                 } else {
                     Dever::db('bill/shop_stat')->insert($insert);
                 }
-                // echo dever::sql();
             }
             
         }