فهرست منبع

Weenier utc项目部署 0623

wesmiler 3 سال پیش
والد
کامیت
c4d785394d
3فایلهای تغییر یافته به همراه70 افزوده شده و 70 حذف شده
  1. 21 7
      app/Http/Controllers/DeptController.php
  2. 0 63
      app/Services/AdService.php
  3. 49 0
      app/Services/Common/AdSortService.php

+ 21 - 7
app/Http/Controllers/DeptController.php

@@ -9,28 +9,42 @@
 // | Author: laravel开发员 <laravel.qq.com>
 // | Author: laravel开发员 <laravel.qq.com>
 // +----------------------------------------------------------------------
 // +----------------------------------------------------------------------
 
 
-namespace App\Http\Controllers;
+namespace App\Http\Controllers\Admin;
 
 
-use App\Services\DeptService;
+
+use App\Services\Common\AdSortService;
 
 
 /**
 /**
- * 部门管理-控制器
+ * 广告位管理-控制器
  * @author laravel开发员
  * @author laravel开发员
  * @since 2020/11/11
  * @since 2020/11/11
- * Class DeptController
+ * Class AdSortController
  * @package App\Http\Controllers
  * @package App\Http\Controllers
  */
  */
-class DeptController extends Backend
+class AdSortController extends Backend
 {
 {
     /**
     /**
      * 构造函数
      * 构造函数
      * @author laravel开发员
      * @author laravel开发员
      * @since 2020/11/11
      * @since 2020/11/11
-     * DeptController constructor.
+     * AdSortController constructor.
      */
      */
     public function __construct()
     public function __construct()
     {
     {
         parent::__construct();
         parent::__construct();
-        $this->service = new DeptService();
+        $this->service = new AdSortService();
     }
     }
+
+    /**
+     * 获取广告位列表
+     * @return mixed
+     * @since 2020/11/11
+     * @author laravel开发员
+     */
+    public function getAdSortList()
+    {
+        $result = $this->service->getAdSortList();
+        return $result;
+    }
+
 }
 }

+ 0 - 63
app/Services/AdService.php

@@ -1,63 +0,0 @@
-<?php
-// +----------------------------------------------------------------------
-// | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
-// +----------------------------------------------------------------------
-// | 版权所有 2017~2021 LARAVEL研发中心
-// +----------------------------------------------------------------------
-// | 官方网站: http://www.laravel.cn
-// +----------------------------------------------------------------------
-// | Author: laravel开发员 <laravel.qq.com>
-// +----------------------------------------------------------------------
-
-namespace App\Services;
-
-use App\Models\AdModel;
-
-/**
- * 广告管理-服务类
- * @author laravel开发员
- * @since 2020/11/11
- * Class AdService
- * @package App\Services
- */
-class AdService extends BaseService
-{
-    /**
-     * 构造函数
-     * @author laravel开发员
-     * @since 2020/11/11
-     * AdService constructor.
-     */
-    public function __construct()
-    {
-        $this->model = new AdModel();
-    }
-
-    /**
-     * 添加或编辑
-     * @return array
-     * @since 2020/11/11
-     * @author laravel开发员
-     */
-    public function edit()
-    {
-        $data = request()->all();
-        // 图片处理
-        $cover = trim($data['cover']);
-        if (strpos($cover, "temp")) {
-            $data['cover'] = save_image($cover, 'ad');
-        } else {
-            $data['cover'] = str_replace(IMG_URL, "", $data['cover']);
-        }
-        // 开始时间
-        if ($data['start_time']) {
-            $data['start_time'] = strtotime($data['start_time']);
-        }
-        // 结束时间
-        if ($data['end_time']) {
-            $data['end_time'] = strtotime($data['end_time']);
-        }
-        return parent::edit($data); // TODO: Change the autogenerated stub
-    }
-
-}

+ 49 - 0
app/Services/Common/AdSortService.php

@@ -0,0 +1,49 @@
+<?php
+// +----------------------------------------------------------------------
+// | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 LARAVEL研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.laravel.cn
+// +----------------------------------------------------------------------
+// | Author: laravel开发员 <laravel.qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services\Common;
+
+use App\Models\AdSortModel;
+use App\Services\BaseService;
+
+/**
+ * 广告位管理-服务类
+ * @author laravel开发员
+ * @since 2020/11/11
+ * Class AdSortService
+ * @package App\Services\Common
+ */
+class AdSortService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author laravel开发员
+     * @since 2020/11/11
+     * AdSortService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new AdSortModel();
+    }
+
+    /**
+     * 获取广告位列表
+     * @return array
+     * @since 2020/11/11
+     * @author laravel开发员
+     */
+    public function getAdSortList()
+    {
+        $list = $this->model->where("mark", '=', 1)->get()->toArray();
+        return message("操作成功", true, $list);
+    }
+
+}