wang hou sheng 7 months ago
parent 933ef035e7
commit 7e81dc2af0
  1. 14
      app/api/model/ActiveMain.php

@ -13,7 +13,6 @@ declare (strict_types=1);
namespace app\api\model; namespace app\api\model;
use app\common\model\ActiveMain as ActiveMainModel; use app\common\model\ActiveMain as ActiveMainModel;
use think\model\relation\HasMany;
/** /**
* 活动模型类 * 活动模型类
@ -32,7 +31,8 @@ class ActiveMain extends ActiveMainModel
]; ];
public function getList($param) { public function getList($param)
{
return $this->with('col.colImage') return $this->with('col.colImage')
->where('status', '=', 1) ->where('status', '=', 1)
->where('id', $param['active_id']) ->where('id', $param['active_id'])
@ -40,13 +40,15 @@ 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['index_image_url']; return !empty($file['index_image_url']) ? $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['theme_image_url']; return !empty($file['theme_image_url']) ? $file['theme_image_url'] : '';
} }
} }

Loading…
Cancel
Save