|
@@ -0,0 +1,61 @@
|
|
|
+<?php
|
|
|
+/**
|
|
|
+ * 前台品牌分类
|
|
|
+ *
|
|
|
+ *
|
|
|
+ *
|
|
|
+ ***/
|
|
|
+
|
|
|
+
|
|
|
+defined('InShopNC') or exit('Access Invalid!');
|
|
|
+
|
|
|
+class typeControl extends mobileHomeControl
|
|
|
+{
|
|
|
+ public function __construct()
|
|
|
+ {
|
|
|
+ parent::__construct();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function searchOp()
|
|
|
+ {
|
|
|
+ if (!empty($_GET['keyword'])) {
|
|
|
+
|
|
|
+ $keyword = urldecode($_GET['keyword']);
|
|
|
+
|
|
|
+ $gc_1 = Model()->table('goods_class')->where(array('gc_name' => array('like', '%' . $keyword . '%')))->limit(1)->select();
|
|
|
+
|
|
|
+ $goods_class = array();
|
|
|
+ if (!empty($gc_1)) {
|
|
|
+
|
|
|
+ $gc_2 = Model()->table('goods_class')->where(array('gc_parent_id' => $gc_1[0]['gc_id']))->select();
|
|
|
+ foreach ($gc_2 as $value) {
|
|
|
+
|
|
|
+ $gc_item_2['gc_id'] = $value['gc_id'];
|
|
|
+ $gc_item_2['gc_name'] = $value['gc_name'];
|
|
|
+
|
|
|
+ $gc_3 = Model()->table('goods_class')->where(array('gc_parent_id' => $value['gc_id']))->select();
|
|
|
+ if (!empty($gc_3)) {
|
|
|
+
|
|
|
+ $gc_3_array = array();
|
|
|
+ foreach ($gc_3 as $item) {
|
|
|
+
|
|
|
+ $gc_3_item['gc_id'] = $item['gc_id'];
|
|
|
+ $gc_3_item['gc_name'] = $item['gc_name'];
|
|
|
+ $gc_3_item['type_id'] = $item['type_id'];
|
|
|
+
|
|
|
+ array_push($gc_3_array, $gc_3_item);
|
|
|
+ }
|
|
|
+
|
|
|
+ $gc_item_2['data'] = $gc_3_array;
|
|
|
+ array_push($goods_class, $gc_item_2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ joutput_data($goods_class);
|
|
|
+
|
|
|
+ } else {
|
|
|
+ joutput_error(1001, "keyword is must!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|