Sfoglia il codice sorgente

wesmiler 报恩寺项目

wesmiler 4 anni fa
parent
commit
466700dd26

+ 37 - 0
app/Http/Controllers/GongdengFoxiangController.php

@@ -0,0 +1,37 @@
+<?php
+// +----------------------------------------------------------------------
+// | Laravel框架 [ Laravel ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京Laravel研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.laravel.cn
+// +----------------------------------------------------------------------
+// | Author: wesmiler <12345678@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Http\Controllers;
+
+use App\Services\GongdengFoxiangService;
+
+/**
+ * 供灯佛像管理-控制器
+ * @author wesmiler
+ * @since 2020/11/11
+ * Class GongdengFoxiangController
+ * @package App\Http\Controllers
+ */
+class GongdengFoxiangController extends Backend
+{
+    /**
+     * 构造函数
+     * @author wesmiler
+     * @since 2020/11/11
+     * GongdengFoxiangController constructor.
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        $this->service = new GongdengFoxiangService();
+    }
+
+}

+ 25 - 0
app/Models/GongdengFoxiangModel.php

@@ -0,0 +1,25 @@
+<?php
+// +----------------------------------------------------------------------
+// | Laravel框架 [ Laravel ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京Laravel研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.laravel.cn
+// +----------------------------------------------------------------------
+// | Author: wesmiler <12345678@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Models;
+
+/**
+ * 供灯佛像-模型
+ * @author wesmiler
+ * @since 2020/11/11
+ * Class GongdengFoxiangModel
+ * @package App\Models
+ */
+class GongdengFoxiangModel extends BaseModel
+{
+    // 设置数据表
+    protected $table = 'gongdeng_foxiang';
+}

+ 57 - 0
app/Services/GongdengFoxiangService.php

@@ -0,0 +1,57 @@
+<?php
+// +----------------------------------------------------------------------
+// | Laravel框架 [ Laravel ]
+// +----------------------------------------------------------------------
+// | 版权所有 2017~2021 南京Laravel研发中心
+// +----------------------------------------------------------------------
+// | 官方网站: http://www.laravel.cn
+// +----------------------------------------------------------------------
+// | Author: wesmiler <12345678@qq.com>
+// +----------------------------------------------------------------------
+
+namespace App\Services;
+
+use App\Models\AdModel;
+use App\Models\GongdengFoxiangModel;
+
+/**
+ * 供灯佛像管理-服务类
+ * @author wesmiler
+ * @since 2020/11/11
+ * Class GongdengFoxiangService
+ * @package App\Services
+ */
+class GongdengFoxiangService extends BaseService
+{
+    /**
+     * 构造函数
+     * @author wesmiler
+     * @since 2020/11/11
+     * GongdengFoxiangService constructor.
+     */
+    public function __construct()
+    {
+        $this->model = new GongdengFoxiangModel();
+    }
+
+    /**
+     * 添加或编辑
+     * @return array
+     * @since 2020/11/11
+     * @author wesmiler
+     */
+    public function edit()
+    {
+        $data = request()->all();
+        // 图片处理
+        $thumb = trim($data['thumb']);
+        if (strpos($thumb, "temp")) {
+            $data['thumb'] = save_image($thumb, 'ad');
+        } else {
+            $data['thumb'] = str_replace(IMG_URL, "", $data['thumb']);
+        }
+        $data['update_time'] = time();
+        return parent::edit($data); // TODO: Change the autogenerated stub
+    }
+
+}

+ 8 - 0
routes/web.php

@@ -302,6 +302,14 @@ Route::post('/lampmeals/edit', [LampMealsController::class, 'edit']);
 Route::post('/lampmeals/delete', [LampMealsController::class, 'delete']);
 Route::post('/lampmeals/status', [LampMealsController::class, 'status']);
 
+// 供灯佛像管理
+Route::get('/gongdengfoxiang/index', [\App\Http\Controllers\GongdengFoxiangController::class, 'index']);
+Route::get('/gongdengfoxiang/info', [\App\Http\Controllers\GongdengFoxiangController::class, 'info']);
+Route::post('/gongdengfoxiang/edit', [\App\Http\Controllers\GongdengFoxiangController::class, 'edit']);
+Route::post('/gongdengfoxiang/delete', [\App\Http\Controllers\GongdengFoxiangController::class, 'delete']);
+Route::post('/gongdengfoxiang/status', [\App\Http\Controllers\GongdengFoxiangController::class, 'status']);
+
+
 // 快递公司
 Route::get('/express/index', [\App\Http\Controllers\ExpressController::class, 'index']);
 Route::get('/express/info', [\App\Http\Controllers\ExpressController::class, 'info']);