123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace catchAdmin\fan\model\get;
- use think\facade\Db;
- trait FanGet
- {
- public function getWindNameAttr()
- {
- $wind_id = $this->wind_id;
- $wind_name = Db::name('wind')->where('id',$wind_id)->value('name');
- return $wind_name;
- }
- public function getImgAttr()
- {
- $data = $this->getData('img');
- if(empty($data))
- {
- $data = [];
- }
- else
- {
- $data = json_decode($data,true);
- }
- return $data;
- }
- public function setImgAttr($value)
- {
-
- return json_encode($value);
- }
-
- }
|