rabin 2 年之前
父节点
当前提交
30dd268f4e
共有 3 个文件被更改,包括 15 次插入3 次删除
  1. 10 3
      app/card/database/info.php
  2. 4 0
      app/card/lib/Goods_set.php
  3. 1 0
      app/card/src/Api.php

+ 10 - 3
app/card/database/info.php

@@ -5,6 +5,12 @@ $type = function()
     return Dever::db('card/type')->state();
 };
 
+$cate = function() 
+{
+    $where['project_id'] = 1;
+    return Dever::db('category/info')->getTop($where);
+};
+
 $card_type = array
 (
     1 => '全数字',
@@ -71,12 +77,13 @@ return array
         'category'      => array
         (
             'type'      => 'varchar-500',
-            'name'      => '可用商品分类',
+            'name'      => '可用商品分类-不选择则所有商品可用',
             'default'   => '',
             'desc'      => '可用商品分类',
             'match'     => 'is_string',
             //'search'    => 'linkage',
-            //'update'    => 'linkage',
+            'update'    => 'checkbox',
+            'option'    => $cate,
             //'option'    => Dever::url('api.get', 'category'),
             //'list'        => 'Dever::load("category/api.string", "{category}")',
         ),
@@ -217,7 +224,7 @@ return array
 
             'list1' => array('卡号列表', '"code&search_option_card_id={id}&oper_table=info"'),
 
-            'location1' => array('商品设置', Dever::url('lib/goods_set.home', 'card')),
+            'location1' => array('可用商品设置', Dever::url('lib/goods_set.home', 'card')),
         ),
     ),
 

+ 4 - 0
app/card/lib/Goods_set.php

@@ -17,6 +17,10 @@ class Goods_set
     {
         $result = array();
         $id = Dever::input('card_id', 1);
+        $card = Dever::input('card/info')->find($id);
+        if (!$card) {
+            return Dever::outDiy($result);
+        }
         $where['project_id'] = 1;
         $data = Dever::db('category/info')->getTop($where);
         if ($data) {

+ 1 - 0
app/card/src/Api.php

@@ -40,6 +40,7 @@ class Api extends Core
             foreach ($this->data['card'] as $k => $v) {
                 $w['type_id'] = $v['id'];
                 $w['status'] = 1;
+                $w['create_type'] = 1;
                 $this->data['card'][$k]['value'] = Dever::db('card/info')->select($w);
             }
         }