rabin 2 роки тому
батько
коміт
5b0a2ccfdc
2 змінених файлів з 13 додано та 7 видалено
  1. 1 1
      app/cash/database/shop_sell.php
  2. 12 6
      app/cash/lib/Set.php

+ 1 - 1
app/cash/database/shop_sell.php

@@ -185,7 +185,7 @@ return array
 
         	'list' => array('查看详情', '"order&project=cash&id={id}&page_type=1&type=shop_sell"'),
 
-            'oper'  => array('确认对账金额', '"cash/lib/set.audit?id={id}&type=shop_sell"', '{status} == 1', 'Dever::load("cash/lib/set.statYes", "{id}", "shop_sell")', '请确认'),
+            'oper'  => array('确认对账金额', '"cash/lib/set.audit?id={id}&type=shop_sell"', '{status} == 1', 'Dever::load("cash/lib/set.statYes", "{id}", "shop_sell", "shop")', '请确认'),
         ),
     ),
 

+ 12 - 6
app/cash/lib/Set.php

@@ -33,12 +33,15 @@ class Set
         return date($string, $day);
     }
 
-    public function statYes($info, $type)
+    public function statYes($info, $type, $source = false)
     {
         $table = 'cash/' . $type;
 
+        if (!$source) {
+            $source = $type;
+        }
         $info = is_array($info) ? $info : Dever::db($table)->one($info);
-        $other = Dever::db($type . '/info')->find($info[$type . '_id']);
+        $other = Dever::db($source . '/info')->find($info[$source . '_id']);
         if (!$other) {
             return '';
         }
@@ -149,6 +152,7 @@ class Set
         $show = Dever::input('show', 1);
         $type = Dever::input('type', 'shop');
         $pay_type = 1;
+        $table = 'cash/' . $type;
         if ($type == 'shop') {
             $search_option_type = 1;
             $name = '门店';
@@ -156,6 +160,7 @@ class Set
             $search_option_type = 1;
             $pay_type = '2,3';
             $name = '门店零售';
+            $type = 'shop';
         } elseif ($type == 'store') {
             $search_option_type = 3;
             $name = '仓库';
@@ -164,8 +169,6 @@ class Set
             $name = '工厂';
         }
 
-        $table = 'cash/' . $type;
-
         $config = Dever::db($table)->config;
 
         $info = Dever::db($table)->one($id);
@@ -401,6 +404,7 @@ class Set
         $pay_type = 1;
         if ($type == 'shop_sell') {
             $pay_type = '2,3';
+            $type = 'shop';
         }
 
         $config = Dever::db($table)->config;
@@ -478,20 +482,22 @@ class Set
         }
 
         $type = Dever::input('type', 'shop');
+
+        $table = 'cash/' . $type;
+        
         $pay_type = 1;
         if ($type == 'shop') {
             $name = '门店';
         } elseif ($type == 'shop_sell') {
             $pay_type = '2,3';
             $name = '门店';
+            $type = 'shop';
         } elseif ($type == 'store') {
             $name = '仓库';
         } elseif ($type == 'factory') {
             $name = '工厂';
         }
 
-        $table = 'cash/' . $type;
-
         $config = Dever::db($table)->config;
 
         $info = Dever::db($table)->one($id);