Browse Source

feat:版本

super-yimizi 2 months ago
parent
commit
4923a50454

+ 2 - 1
application/admin/controller/Feedback.php

@@ -25,7 +25,7 @@ class Feedback extends Backend
     public function _initialize()
     public function _initialize()
     {
     {
         parent::_initialize();
         parent::_initialize();
-        $this->model = new \app\common\model\Feedback;
+        $this->model = new \app\admin\model\Feedback;
         $this->view->assign("statusList",StatusEnum::getMap());
         $this->view->assign("statusList",StatusEnum::getMap());
         $this->assignconfig('statusSearchList',json_encode(StatusEnum::getMap()));
         $this->assignconfig('statusSearchList',json_encode(StatusEnum::getMap()));
         $this->view->assign("processStatusList",FeedbackEnum::getProcessStatusMap());
         $this->view->assign("processStatusList",FeedbackEnum::getProcessStatusMap());
@@ -47,6 +47,7 @@ class Feedback extends Backend
      */
      */
     public function index()
     public function index()
     {
     {
+         //当前是否为关联查询
         //设置过滤方法
         //设置过滤方法
         $this->request->filter(['strip_tags', 'trim']);
         $this->request->filter(['strip_tags', 'trim']);
         if ($this->request->isAjax()) {
         if ($this->request->isAjax()) {

+ 49 - 0
application/admin/model/Feedback.php

@@ -0,0 +1,49 @@
+<?php
+
+namespace app\admin\model;
+
+use think\Model;
+use traits\model\SoftDelete;
+use app\common\Enum\FeedbackEnum;
+class Feedback extends Model
+{
+
+    use SoftDelete;
+    // 表名
+    protected $table = 'shop_feedback';
+    
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = 'integer';
+
+    // 定义时间戳字段名
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+    protected $deleteTime = 'deletetime';
+
+    // 追加属性
+    protected $append = [
+
+    ];
+    
+    public function user()
+    {
+        return $this->belongsTo('User', 'user_id', 'id')->setEagerlyType(0);
+    }
+
+    public function getTypeTextAttr($value, $data)
+    {
+        return FeedbackEnum::getFeedbackTypeText($data['type']);
+    }
+     
+    public function getImageTextAttr($value, $data){
+        return  json_decode($data['images'], true);
+    }
+    
+
+
+
+
+
+
+
+}

+ 1 - 1
public/assets/js/backend/feedback.js

@@ -37,7 +37,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                         {checkbox: true},
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'id', title: __('Id')},
                         {
                         {
-                            field: 'user.username', title: __('User_id'), operate: false,
+                            field: 'user.username', title: __('User_id'),operate: 'LIKE',
                             formatter: function (value, row, index) {
                             formatter: function (value, row, index) {
                                 // 显示用户头像和用户名
                                 // 显示用户头像和用户名
                                 var avatar = row.user && row.user.avatar ? row.user.avatar : '/assets/img/avatar.png';
                                 var avatar = row.user && row.user.avatar ? row.user.avatar : '/assets/img/avatar.png';