lizhen_gitee 1 年間 前
コミット
6faa47850d

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

@@ -54,7 +54,7 @@ class Topicdongtaianswer extends Backend
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 
             $list = $this->model
-                    ->with(['user','topicdongtai'])
+                    ->with(['user'])
                     ->where($where)
                     ->order($sort, $order)
                     ->paginate($limit);
@@ -62,7 +62,6 @@ class Topicdongtaianswer extends Backend
             foreach ($list as $row) {
                 
                 $row->getRelation('user')->visible(['username']);
-				$row->getRelation('topicdongtai')->visible(['id']);
             }
 
             $result = array("total" => $list->total(), "rows" => $list->items());

+ 13 - 13
application/admin/lang/zh-cn/topicdongtaianswer.php

@@ -1,17 +1,17 @@
 <?php
 
 return [
-    'Id'              => 'ID',
-    'Dt_id'           => '动态ID',
-    'Floor'           => '楼层',
-    'User_id'         => '用户ID',
-    'Content'         => '内容',
-    'To_user_id'      => '对谁说',
-    'Level'           => '回复类型',
-    'Level 1'         => '层主回复',
-    'Level 2'         => '层中回复',
-    'Createtime'      => '创建时间',
-    'Updatetime'      => '更新时间',
-    'User.username'   => '用户名',
-    'Topicdongtai.id' => 'ID'
+    'Id'            => 'ID',
+    'Dt_id'         => '动态ID',
+    'Floor'         => '楼层',
+    'User_id'       => '用户ID',
+    'Content'       => '内容',
+    'To_user_id'    => '对谁说',
+    'Goodnum'       => '点赞数量',
+    'Level'         => '回复类型',
+    'Level 1'       => '层主回复',
+    'Level 2'       => '层中回复',
+    'Createtime'    => '创建时间',
+    'Updatetime'    => '更新时间',
+    'User.username' => '用户名'
 ];

+ 0 - 6
application/admin/model/Topicdongtaianswer.php

@@ -50,10 +50,4 @@ class Topicdongtaianswer extends Model
     {
         return $this->belongsTo('User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
     }
-
-
-    public function topicdongtai()
-    {
-        return $this->belongsTo('Topicdongtai', 'dt_id', 'id', [], 'LEFT')->setEagerlyType(0);
-    }
 }

+ 7 - 1
application/admin/view/topicdongtaianswer/add.html

@@ -21,7 +21,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-content" class="form-control" name="row[content]" type="text">
+            <input id="c-content" class="form-control" name="row[content]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
@@ -31,6 +31,12 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Goodnum')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-goodnum" class="form-control" name="row[goodnum]" type="number" value="0">
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Level')}:</label>
         <div class="col-xs-12 col-sm-8">
                         

+ 6 - 0
application/admin/view/topicdongtaianswer/edit.html

@@ -31,6 +31,12 @@
         </div>
     </div>
     <div class="form-group">
+        <label class="control-label col-xs-12 col-sm-2">{:__('Goodnum')}:</label>
+        <div class="col-xs-12 col-sm-8">
+            <input id="c-goodnum" class="form-control" name="row[goodnum]" type="number" value="{$row.goodnum|htmlentities}">
+        </div>
+    </div>
+    <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Level')}:</label>
         <div class="col-xs-12 col-sm-8">
                         

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

@@ -31,11 +31,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
 //                        {field: 'user_id', title: __('User_id')},
                         {field: 'content', title: __('Content'), operate: 'LIKE'},
 //                        {field: 'to_user_id', title: __('To_user_id')},
+                        {field: 'goodnum', title: __('Goodnum')},
                         {field: 'level', title: __('Level'), searchList: {"1":__('Level 1'),"2":__('Level 2')}, formatter: Table.api.formatter.normal},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
-//                        {field: 'topicdongtai.id', title: __('Topicdongtai.id')},
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]