@ -20,7 +20,15 @@ use app\common\model\ActiveCol as 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) {
$file = $this->with('indexImage')->find();
return $file['indexImage']['preview_url'];
return $file['index_image_url'];
public function getThemePicAttr($value, $data) {
$file = $this->with('themeImage')->find();
return $file['themeImage']['preview_url'];
return $file['theme_image_url'];