tongshanglei 2 年之前
父节点
当前提交
5ccdb92d8b
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      catch/alarm/model/ControlAlarm.php

+ 4 - 4
catch/alarm/model/ControlAlarm.php

@@ -41,7 +41,7 @@ class ControlAlarm extends Model
     {
         $res=$this->dataRange()
             ->catchSearch()
-
+            ->append(['state_text'])
             ->order($this->aliasField('id'), 'desc')
             ->paginate();
         return $res;
@@ -53,9 +53,9 @@ class ControlAlarm extends Model
     // }
 
     
-    public function getStateAttr($value){
-        // $state = $this->getData('state');
-        return (new SysDictData())->getValueByCode('AlarmHandleState', $value) ?: '';
+    public function getStateTextAttr($value){
+        $state = $this->getData('state');
+        return (new SysDictData())->getValueByCode('AlarmHandleState', $state) ?: '';
     }
     public function getAlarmTypeAttr($value){