dever 3 年之前
父节点
当前提交
e25853c2a2

+ 1 - 1
service/bill/database/cash.php

@@ -85,7 +85,7 @@ return array
             'update'    => 'text',
             'search'    => $mid ? 'hidden' : array
             (
-                'api' => 'agent/member-select',
+                'api' => 'agent/member-find',
                 'col' => 'mobile',
                 'result' => 'id',
             ),

+ 1 - 1
service/bill/database/sell.php

@@ -62,7 +62,7 @@ return array
             'update'    => 'text',
             'search'    => $mid ? 'hidden' : array
             (
-                'api' => 'agent/member-select',
+                'api' => 'agent/member-find',
                 'col' => 'mobile',
                 'result' => 'id',
             ),

+ 1 - 1
service/bill/database/sell_stat.php

@@ -43,7 +43,7 @@ return array
             'update'    => 'text',
             'search'    => array
             (
-                'api' => 'agent/member-select',
+                'api' => 'agent/member-find',
                 'col' => 'mobile',
                 'result' => 'id',
             ),

+ 1 - 1
service/bill/database/tixian.php

@@ -60,7 +60,7 @@ return array
             'update'    => 'text',
             'search'    => $mid ? 'hidden' : array
             (
-                'api' => 'agent/member-select',
+                'api' => 'agent/member-find',
                 'col' => 'mobile',
                 'result' => 'id',
             ),

+ 14 - 0
service/bill/lib/Cron.php

@@ -43,6 +43,15 @@ class Cron
     }
 
     # 区域分润
+    /*
+    区域毛利  =  区域内所有门店的采购商品的零售价总额  x  30%
+
+    城市分润  =  区域毛利 x 1%
+
+    区县分润  =  区域毛利 x 3%
+
+    街道分润  =  区域毛利 x 5%
+    */
     public function area_api()
     {
         # 获取所有代理商
@@ -52,10 +61,15 @@ class Cron
             foreach ($member as $k => $v) {
                 # 获取区域内门店的利润
                 $role = Dever::db('setting/role')->find($v['role']);
+                $profit = $role['profit'];
+                if (!$profit) {
+                    continue;
+                }
                 $temp = explode(',', $v['area']);
                 if ($role['type'] == 2) {
                     if ($role['area'] == 1) {
                         # 城市
+
                     } elseif ($role['area'] == 2) {
                         # 区县
                     } elseif ($role['area'] == 3) {

+ 1 - 1
service/setting/database/role.php

@@ -129,7 +129,7 @@ return array
 
         'profit'      => array
         (
-            'type'      => 'float-11,2',
+            'type'      => 'int-11',
             'name'      => '收益-区域内门店利润百分比,这里直接输入数字即可,如输入10,就是10%',
             'default'   => '0',
             'desc'      => '收益',