diff --git a/application/admin/model/special/OfflineCourse.php b/application/admin/model/special/OfflineCourse.php index 1828be72..aad95e6c 100644 --- a/application/admin/model/special/OfflineCourse.php +++ b/application/admin/model/special/OfflineCourse.php @@ -38,6 +38,23 @@ class OfflineCourse extends ModelBasic return compact('data', 'count'); } + public function getApplyStartTimeAttr($time) + { + return date("Y-m-d", $time); + } + public function getApplyEndTimeAttr($time) + { + return date("Y-m-d", $time); + } + public function getStartTimeAttr($time) + { + return date("Y-m-d", $time); + } + public function getEndTimeAttr($time) + { + return date("Y-m-d", $time); + } + public static function setWhere($where) { $model = new self(); diff --git a/application/admin/view/special/audio_video/add.php b/application/admin/view/special/audio_video/add.php index ec1f1823..cd86e5f8 100755 --- a/application/admin/view/special/audio_video/add.php +++ b/application/admin/view/special/audio_video/add.php @@ -99,6 +99,11 @@
输入标签名称后点击”+“号按钮添加;最多写入6个字;点击标签即可删除
+
+
+ +
+
@@ -106,12 +111,6 @@
- -
-
- -
-
diff --git a/application/admin/view/special/image_text/add.php b/application/admin/view/special/image_text/add.php index 0b76ac9e..32277e1e 100755 --- a/application/admin/view/special/image_text/add.php +++ b/application/admin/view/special/image_text/add.php @@ -96,14 +96,6 @@
输入标签名称后点击”+“号按钮添加;最多写入6个字;点击标签即可删除
-
- -
- - -
-
-
+ +
+ +
+ + +
+
+
diff --git a/application/admin/view/special/special_single/add.php b/application/admin/view/special/special_single/add.php index e7a4f74c..29dc46e3 100755 --- a/application/admin/view/special/special_single/add.php +++ b/application/admin/view/special/special_single/add.php @@ -105,6 +105,13 @@
输入标签名称后点击”+“号按钮添加;最多写入6个字;点击标签即可删除
+
+
+ +
+
+
@@ -113,12 +120,6 @@
-
-
- -
-
diff --git a/application/wap/controller/Store.php b/application/wap/controller/Store.php index dc258e85..ce2d3baf 100755 --- a/application/wap/controller/Store.php +++ b/application/wap/controller/Store.php @@ -83,21 +83,38 @@ class Store extends AuthController */ public function getCategory() { - $parentCategory = StoreCategory::pidByCategory(0, 'id,cate_name'); - $parentCategory = count($parentCategory) > 0 ? $parentCategory->toArray() : []; - return JsonService::successful($parentCategory); + $cateogry = StoreCategory::with('children')->where(['is_show' => 1])->order('sort desc,id desc')->where('pid', 0)->select(); + return JsonService::successful($cateogry->toArray()); } /**商品列表 - * @param string $keyword + * @param int $page + * @param int $limit * @param int $cId - * @param int $first + * @param string $keyword + * @return null + */ + public function getProductList($page = 1, $limit = 8, $cId = 0, $keyword = '') + { + if (!empty($keyword)) $keyword = base64_decode(htmlspecialchars($keyword)); + $model = StoreProduct::validWhere(); + if (!empty($cId)) $model = $model->where('cate_id', $cId); + if (!empty($keyword)) $model->where('keyword|store_name', 'LIKE', "%$keyword%"); + $model->order('sort DESC, add_time DESC'); + $list = $model->page((int)$page, (int)$limit)->field('id,mer_id,store_name,image,sales,price,stock,IFNULL(sales,0) + IFNULL(ficti,0) as sales,keyword')->select(); + $list = count($list) > 0 ? $list->toArray() : []; + return JsonService::successful($list); + } + + + /**商品推荐列表 + * @param int $page * @param int $limit - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\ModelNotFoundException - * @throws \think\exception\DbException + * @param int $cId + * @param string $keyword + * @return null */ - public function getProductList($page = 1, $limit = 8, $cId = 0) + public function getRecommendProductList($page = 1, $limit = 8, $cId = 0, $keyword = '') { if (!empty($keyword)) $keyword = base64_decode(htmlspecialchars($keyword)); $model = StoreProduct::validWhere(); diff --git a/application/wap/model/store/StoreCategory.php b/application/wap/model/store/StoreCategory.php index c5405414..4c90c7f7 100755 --- a/application/wap/model/store/StoreCategory.php +++ b/application/wap/model/store/StoreCategory.php @@ -46,4 +46,13 @@ class StoreCategory extends ModelBasic return self::where('id', $cateId)->value('pid'); } + + /**获取二级分类 + * @return \think\model\relation\HasMany + */ + public function children() + { + return $this->hasMany('StoreCategory', 'pid', 'id')->where(['is_show' => 1])->order('sort DESC,id DESC'); + } + }