WIN-2308041133\Administrator 6 mēneši atpakaļ
vecāks
revīzija
71b3cac86b

+ 2 - 1
application/admin/controller/wechat/Plan.php

@@ -19,7 +19,8 @@ class Plan extends Backend
     public function _initialize()
     {
         parent::_initialize();
-        $this->model = model('WechatPlan');
+        $this->model = new \app\admin\model\WechatPlan;
+        $this->view->assign("hidedataList", $this->model->getHidedataList());
     }
 
     /**

+ 3 - 0
application/admin/lang/zh-cn/wechat/plan.php

@@ -9,6 +9,9 @@ return [
     'Num'        => '参与人数',
     'Info'       => '模版介绍',
     'Text'       => '模版详情',
+    'Hidedata'   => '是否隐藏',
+    'Hidedata 0' => '否',
+    'Hidedata 1' => '是',
     'Createtime' => '创建时间',
     'Updatetime' => '更新时间'
 ];

+ 10 - 1
application/admin/model/WechatPlan.php

@@ -12,7 +12,16 @@ class WechatPlan extends Model
     // 定义时间戳字段名
     protected $createTime = 'createtime';
     protected $updateTime = 'updatetime';
-
+    public function getHidedataList()
+    {
+        return ['0' => __('Hidedata 0'), '1' => __('Hidedata 1')];
+    }
+    public function getHidedataTextAttr($value, $data)
+    {
+        $value = $value ? $value : (isset($data['hidedata']) ? $data['hidedata'] : '');
+        $list = $this->getHidedataList();
+        return isset($list[$value]) ? $list[$value] : '';
+    }
     public static function lst($where)
     {
         $model = new self;

+ 2 - 1
public/assets/js/backend/wechat/plan.js

@@ -30,8 +30,9 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
                         {field: 'price', title: __('Price')},
                         {field: 'num', title: __('Num')},
                         {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
-                        {field: 'updatetime', title: __('Update time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
+                        // {field: 'updatetime', title: __('Update time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                         // {field: 'status', title: __('Status'), formatter: Table.api.formatter.status},
+                        {field: 'hidedata', title: __('hidedata'), searchList: {"0":__('hidedata 0'),"1":__('hidedata 1')}, formatter: Table.api.formatter.normal},
                         {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                     ]
                 ]