dever il y a 3 ans
Parent
commit
01ad5c7851

+ 2 - 1
service/agent/database/order_process.php

@@ -148,11 +148,12 @@ return array
         'soft_price'      => array
         (
             'type'      => 'float-11,2',
-            'name'      => '软件服务费-如填写这里的软件服务费,将不使用角色设置的拆分规则',
+            'name'      => '软件服务费',
             'default'   => '0',
             'desc'      => '金额',
             'match'     => 'option',
             'update'    => 'text',
+            'value'     => Dever::input('soft_price', '0'),
             'show'      => 'cstatus=2',
         ),
 

+ 6 - 5
service/agent/lib/Member.php

@@ -131,13 +131,14 @@ class Member
      */
     public function up($member, $order_id, $role, $type, $mid, $cash, $sell, $level_id = false, $desc = '', $group_num = 0)
     {
-        # 增加日志
-        Dever::load('bill/lib/cash')->up($mid, $type, $cash, $role, $order_id, $desc, 2);
+        $data['where_id'] = $mid;
+        if ($cash != 0) {
+            Dever::load('bill/lib/cash')->up($mid, $type, $cash, $role, $order_id, $desc, 2);
+            $data['cash'] = $cash;
+        }
 
         Dever::load('bill/lib/sell')->up($mid, $type, $sell, $role, $order_id, $desc);
-
-        $data['where_id'] = $mid;
-        $data['cash'] = $cash;
+        
         $data['upcol'] = $sell;
         if ($level_id) {
             $data['level_id'] = $level_id;

+ 24 - 12
service/agent/lib/Order.php

@@ -546,9 +546,15 @@ class Order
     {
         $button = array();
         $cstatus = ',cstatus,soft_price';
+        $soft_price = 0;
         if ($role['soft'] && $role['soft'] && $info['price'] > 0 && $info['status'] > 1) {
             //$cstatus = ',cstatus';
             //$soft = '【<a href="" style="color:blue">拆分代理费</a>】';
+            if (strstr($role['soft'], '%')) {
+                $role['soft'] = str_replace('%', '', $role['soft']);
+                $role['soft'] = $info['price'] * ($role['soft']/100);
+            }
+            $soft_price = $role['soft'];
         }
 
         if ($info['status'] <= 3 && $info['status'] > 0) {
@@ -579,7 +585,7 @@ class Order
                     $cstatus = ',prize_type';
                 }
             }
-            $purl = Dever::url('project/database/update?project=agent&table=order_process&order_id='.$info['id'].'&status=1&col=order_id,status,audit,price,desc'.$cstatus.'&price='.$info['price'], 'manage');
+            $purl = Dever::url('project/database/update?project=agent&table=order_process&order_id='.$info['id'].'&status=1&col=order_id,status,audit,price,desc'.$cstatus.'&price='.$info['price'].'&soft_price=' . $soft_price, 'manage');
             if (isset($process[1]) && $process[1]) {
                 $purl .= '&where_id=' . $process[1]['id'];
             }
@@ -631,6 +637,7 @@ class Order
         $parent_per = 0;
         $max_per = 15;
         $level_up = false;
+        $html = '';
         foreach ($parents as $k => $v) {
             $parent_info = Dever::db('agent/member')->find($v['uid']);
             if ($parent_info && $parent_info['status'] == 2) {
@@ -688,17 +695,16 @@ class Order
                 if ($k == 0) {
                     $parent_name = $this->show_parent_reward($parent_info, $info, $role, $v, $parent_role, $parent_level, $child_num);
                 }
-                if ($parent_level['id'] && $parent_level['value'] > 0) {
 
-                    $param = array();
-                    $param['type'] = 2;
-                    $param['order_id'] = $info['id'];
-                    $param['parent_mid'] = $parent_info['id'];
-                    if (isset($level_up) && $level_up && isset($level) && $level) {
-                        $param['parent_level'] = $level['id'];
-                        $param['child_num'] = $child_num;
-                    }
-                    
+                $param = array();
+                $param['type'] = 2;
+                $param['order_id'] = $info['id'];
+                $param['parent_mid'] = $parent_info['id']; 
+                if (isset($level_up) && $level_up && isset($level) && $level) {
+                    $param['parent_level'] = $level['id'];
+                    $param['child_num'] = $child_num;
+                }
+                if ($parent_level['id'] && $parent_level['value'] > 0) {
                     $param['cash'] = $cash;
                     $param['per'] = $parent_level['value'];
 
@@ -707,6 +713,12 @@ class Order
                     $cash = '<a style="color:blue" class="set_cash" data-param="'.$data_param.'">' . $cash . '</a>';
 
                     $table['body'][] = array($parent_info['name'], $parent_role['name'], $parent_level['name'], $parent_level['value'] . '%', $cash);
+                } else {              
+                    $param['cash'] = 0;
+                    $param['per'] = 0;
+                    $data_param = Dever::array_encode($param);
+
+                    $html .= '<a style="color:blue;display:none;" class="set_cash" data-param="'.$data_param.'">&nbsp;&nbsp;</a>';
                 }
             }
         }
@@ -719,7 +731,7 @@ class Order
             $parent_title = '(已发放分润)';
             $parent_button = array();
         } else {
-            $parent_title = '(未发放分润)';
+            $parent_title = '(未发放分润)' . $html;
             /*
             $parent_button[] = array
             (

+ 21 - 0
service/option/src/My.php

@@ -39,6 +39,27 @@ class My extends Core
             $this->data['agreement_state'] = 1;
         }
 
+        $agreement = Dever::db('option/agreement')->getOne(array('aid' => $this->uid));
+
+        $audit = array
+        (
+            'status' => 1,
+            'desc' => '',
+            'date' => date('Y.m.d H:i'),
+        );
+
+        if ($agreement) {
+            if ($agreement['audit'] == 3 && $total > 0) {
+                $audit['status'] = 1;
+                $audit['desc'] = '';
+            } else {
+                $audit['status'] = $agreement['audit'];
+                $audit['desc'] = $agreement['audit_desc'];
+            }
+        }
+
+        $this->data['audit'] = $audit;
+
         if ($this->data['cash']) {
             foreach ($this->data['cash'] as $k => $v) {
                 if ($v['type'] == 1) {