Wayne 9 months ago
commit 761fbf251c
  1. 8
      app/api/model/ActiveCol.php
  2. 4
      app/api/model/ActiveMain.php

@ -20,7 +20,15 @@ use app\common\model\ActiveCol as ActiveColModel;
*/ */
class ActiveCol extends ActiveColModel class ActiveCol extends ActiveColModel
{ {
//追加字段
protected $append = [
'col_pic'
];
public function getColPicAttr($value, $data) {
$file = $this->with(['colImage'])->find();
return $file['col_image_url'];
}
} }

@ -42,11 +42,11 @@ class ActiveMain extends ActiveMainModel
public function getIndexIconAttr($value, $data) { public function getIndexIconAttr($value, $data) {
$file = $this->with('indexImage')->find(); $file = $this->with('indexImage')->find();
return $file['indexImage']['preview_url']; return $file['index_image_url'];
} }
public function getThemePicAttr($value, $data) { public function getThemePicAttr($value, $data) {
$file = $this->with('themeImage')->find(); $file = $this->with('themeImage')->find();
return $file['themeImage']['preview_url']; return $file['theme_image_url'];
} }
} }

Loading…
Cancel
Save