Ver código fonte

wesmiler 抢表商城

APPLE 3 anos atrás
pai
commit
cdbc58c15e
2 arquivos alterados com 39 adições e 39 exclusões
  1. 0 39
      app/Services/BaseService.php
  2. 39 0
      app/Services/Common/NoticeService.php

+ 0 - 39
app/Services/BaseService.php

@@ -167,45 +167,6 @@ class BaseService
     }
 
     /**
-     * 列表数据
-     * @param $params
-     * @param int $pageSize
-     * @return array
-     */
-    public function getDataList($params, $pageSize = 15)
-    {
-        $where = ['a.mark' => 1,'status'=>1];
-        $status = isset($params['status'])? $params['status'] : 0;
-        if($status>0){
-            $where['a.status'] = $status;
-        }
-        $list = $this->model->from('notices as a')
-            ->where($where)
-            ->where(function ($query) use($params){
-                $keyword = isset($params['keyword'])? $params['keyword'] : '';
-                if($keyword){
-                    $query->where('a.title','like',"%{$keyword}%");
-
-                }
-            })
-            ->select(['a.*'])
-            ->orderBy('a.id','desc')
-            ->paginate($pageSize > 0 ? $pageSize : 9999999);
-        $list = $list? $list->toArray() :[];
-        if($list){
-            foreach($list['data'] as &$item){
-                $item['create_time'] = $item['create_time']? datetime($item['create_time'],'Y-m-d H.i.s') : '';
-            }
-        }
-
-        return [
-            'pageSize'=> $pageSize,
-            'total'=>isset($list['total'])? $list['total'] : 0,
-            'list'=> isset($list['data'])? $list['data'] : []
-        ];
-    }
-
-    /**
      * 获取记录详情
      * @return array
      * @since 2020/11/11

+ 39 - 0
app/Services/Common/NoticeService.php

@@ -35,6 +35,45 @@ class NoticeService extends BaseService
     }
 
     /**
+     * 列表数据
+     * @param $params
+     * @param int $pageSize
+     * @return array
+     */
+    public function getDataList($params, $pageSize = 15)
+    {
+        $where = ['a.mark' => 1,'status'=>1];
+        $status = isset($params['status'])? $params['status'] : 0;
+        if($status>0){
+            $where['a.status'] = $status;
+        }
+        $list = $this->model->from('notice as a')
+            ->where($where)
+            ->where(function ($query) use($params){
+                $keyword = isset($params['keyword'])? $params['keyword'] : '';
+                if($keyword){
+                    $query->where('a.title','like',"%{$keyword}%");
+
+                }
+            })
+            ->select(['a.*'])
+            ->orderBy('a.id','desc')
+            ->paginate($pageSize > 0 ? $pageSize : 9999999);
+        $list = $list? $list->toArray() :[];
+        if($list){
+            foreach($list['data'] as &$item){
+                $item['create_time'] = $item['create_time']? datetime($item['create_time'],'Y-m-d H.i.s') : '';
+            }
+        }
+
+        return [
+            'pageSize'=> $pageSize,
+            'total'=>isset($list['total'])? $list['total'] : 0,
+            'list'=> isset($list['data'])? $list['data'] : []
+        ];
+    }
+
+    /**
      * 设置置顶
      * @return array
      * @since 2020/11/21