dever пре 4 година
родитељ
комит
f5631b06de
2 измењених фајлова са 20 додато и 2 уклоњено
  1. 7 1
      app/collection/lib/Content.php
  2. 13 1
      app/content/database/product.php

+ 7 - 1
app/collection/lib/Content.php

@@ -12,13 +12,19 @@ class Content
 		$where['info_id'] = $info_id;
 		$data = Dever::db('collection/content')->getAllPage($where);
 
+        $result = array();
 		if ($data) {
+            $i = 0;
 			foreach ($data as $k => $v) {
 				$data[$k] = $this->getOne($v);
+                if ($data[$k]['data']) {
+                    $result[$i] = $data[$k];
+                    $i++;
+                }
 			}
 		}
 
-		return $data;
+		return $result;
 	}
 
 	public function getOne($data)

+ 13 - 1
app/content/database/product.php

@@ -200,6 +200,18 @@ return array
 	# request 请求接口定义
 	'request' => array
 	(
-		
+		'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'info_id' => 'yes',
+                'content_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('reorder' => 'desc', 'id' => 'desc'),
+            'col' => '*',
+        ),
 	),
 );