rabin 2 years ago
parent
commit
2e42945775
1 changed files with 19 additions and 3 deletions
  1. 19 3
      service/agent/lib/Set.php

+ 19 - 3
service/agent/lib/Set.php

@@ -68,7 +68,12 @@ class Set
                     $data[0]['children'][$k]['total'] = 0;
                     $data[0]['children'][$k]['end'] = true;
 
-                    $info = Dever::db($table)->find(array('type' => 3, 'type_id' => $v['id'], $col => $value));
+                    $w = array('type' => 3, 'type_id' => $v['id'], $col => $value);
+                    $give = Dever::input('give');
+                    if ($give) {
+                        $w['give'] = $give;
+                    }
+                    $info = Dever::db($table)->find($w);
                     if ($info) {
                         if ($table == 'agent/member_goods') {
                             $info['num'] = $info['total_num'] - $info['sell_num'];
@@ -108,7 +113,13 @@ class Set
                 $data[1]['children'][$k]['end'] = true;
 
                 if ($table == 'agent/member_goods') {
-                    $info = Dever::db($table)->select(array('type' => 2, 'type_id' => $v['id'], $col => $value));
+
+                    $w = array('type' => 2, 'type_id' => $v['id'], $col => $value);
+                    $give = Dever::input('give');
+                    if ($give) {
+                        $w['give'] = $give;
+                    }
+                    $info = Dever::db($table)->select($w);
                     if ($info) {
                         $num = 0;
                         $data[1]['children'][$k]['price'] = 0;
@@ -126,7 +137,12 @@ class Set
                         $data[1]['children'][$k]['total'] = $num;
                     }
                 } else {
-                    $info = Dever::db($table)->find(array('type' => 2, 'type_id' => $v['id'], $col => $value));
+                    $w = array('type' => 2, 'type_id' => $v['id'], $col => $value);
+                    $give = Dever::input('give');
+                    if ($give) {
+                        $w['give'] = $give;
+                    }
+                    $info = Dever::db($table)->find($w);
                     if ($info) {
                         $data[1]['children'][$k]['select'] = 1;
                         if ($v['create_type'] == 3) {