dever 3 năm trước cách đây
mục cha
commit
dfe3defbaf
4 tập tin đã thay đổi với 37 bổ sung15 xóa
  1. 8 3
      app/mshop/lib/Out.php
  2. 6 1
      app/mshop/src/Out.php
  3. 20 9
      app/shop/database/out_order.php
  4. 3 2
      app/store/admin/Out.php

+ 8 - 3
app/mshop/lib/Out.php

@@ -204,7 +204,8 @@ class Out
         $info['cdate'] = date('Y-m-d H:i', $info['cdate']);
 
         $type = Dever::db('shop/out_order')->config['config_type'];
-        $info['type_name'] = $type[$info['out_type']];
+        $type = $type();
+        $info['type_name'] = $type[$info['out_type']]['name'];
 
         $status = Dever::db('shop/out_order')->config['config_status'];
         $info['status_name'] = $status[$info['status']];
@@ -231,7 +232,9 @@ class Out
 
         $status = $config['config_status'][$info['status']];
 
-        $out_type = $config['config_type'][$info['out_type']];
+        $config_type = $config['config_type'];
+        $config_type = $config_type();
+        $out_type = $config_type[$info['out_type']]['name'];
 
         $cdate = date('Y-m-d H:i', $info['cdate']);
         
@@ -385,7 +388,9 @@ class Out
 
         $status = $config['config_status'][$info['status']];
 
-        $out_type = $config['config_type'][$info['out_type']];
+        $config_type = $config['config_type'];
+        $config_type = $config_type();
+        $out_type = $config_type[$info['out_type']]['name'];
 
         $cdate = date('Y-m-d H:i', $info['cdate']);
 

+ 6 - 1
app/mshop/src/Out.php

@@ -33,7 +33,12 @@ class Out extends Core
     public function info()
     {
         $this->data['user'] = $this->user;
-        $this->data['type'] = Dever::db('shop/out_order')->config['config_type'];
+        $type = Dever::db('shop/out_order')->config['config_type'];
+        $type = $type();
+        $this->data['type'] = array();
+        foreach ($type as $k => $v) {
+            $this->data['type'][$v['id']] = $v['name'];
+        }
         return $this->data;
     }
 

+ 20 - 9
app/shop/database/out_order.php

@@ -1,14 +1,5 @@
 <?php
 
-$out_type = array
-(
-    1 => '店铺活动',
-    2 => '礼品赠送',
-    3 => '保质期到期销毁',
-    4 => '库存损毁',
-    10 => '其他',
-);
-
 $status = array
 (
     1 => '待审核',
@@ -45,10 +36,30 @@ if ($search == 1) {
     $search_name = '所属门店';
     $search_option = $shop;
     $search_url = 'shop/lib/manage.search';
+    $out_type = function()
+    {
+        $array = array();
+        $info = Dever::db('shop/out_type')->getAll(array('type' => '1,10'));
+        if($info)
+        {
+            $array += $info;
+        }
+        return $array;
+    };
 } elseif ($search != 1) {
     $search_name = '所属仓库';
     $search_option = $store;
     $search_url = 'store/lib/manage.search';
+    $out_type = function()
+    {
+        $array = array();
+        $info = Dever::db('shop/out_type')->getAll(array('type' => '2,10'));
+        if($info)
+        {
+            $array += $info;
+        }
+        return $array;
+    };
 }
 
 return array

+ 3 - 2
app/store/admin/Out.php

@@ -60,14 +60,15 @@ class Out extends Core
     public function getType($state = 1)
     {
         $type = Dever::db('shop/out_order')->config['config_type'];
+        $type = $type();
         $config = array
         (
             array('value' => '0', 'name' => '全部'),
         );
 
         foreach ($type as $k => $v) {
-            if ($k > 2) {
-                $config[] = array('value' => $k, 'name' => $v);
+            if ($v['type'] != 1) {
+                $config[] = array('value' => $k, 'name' => $v['name']);
             }
         }