|
|
@@ -20,6 +20,7 @@
|
|
|
namespace app\common\model;
|
|
|
|
|
|
use app\common\enum\YesNoEnum;
|
|
|
+use app\common\model\InfoCategory;
|
|
|
use app\common\service\FileService;
|
|
|
use think\model\concern\SoftDelete;
|
|
|
|
|
|
@@ -28,6 +29,16 @@ class Info extends BaseModel
|
|
|
use SoftDelete;
|
|
|
protected $deleteTime = 'delete_time';
|
|
|
|
|
|
+ /**
|
|
|
+ * @notes 关联分类
|
|
|
+ * @return \think\model\relation\HasMany
|
|
|
+ * @author 段誉
|
|
|
+ * @date 2022/10/19 16:59
|
|
|
+ */
|
|
|
+ public function category()
|
|
|
+ {
|
|
|
+ return $this->hasOne(InfoCategory::class, 'id', 'cid')->field('id,type,name');
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* @notes 状态获取器
|
|
|
@@ -37,9 +48,9 @@ class Info extends BaseModel
|
|
|
* @author ljj
|
|
|
* @date 2021/7/31 3:26 下午
|
|
|
*/
|
|
|
- public function getStatusDescAttr($value, $data)
|
|
|
+ public function getIsShowDescAttr($value, $data)
|
|
|
{
|
|
|
- return YesNoEnum::getStatusDesc($data['status']);
|
|
|
+ return YesNoEnum::getStatusDesc($data['is_show']);
|
|
|
}
|
|
|
|
|
|
/**
|