<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台（PHP版）
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码，建议反馈是我们前进的动力
// | 开源版本可自由商用，可去除界面版权logo
// | gitee下载：https://gitee.com/likeshop_gitee/likeadmin
// | github下载：https://github.com/likeshop-github/likeadmin
// | 访问官网：https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------

namespace app\common\model\group_activity;

use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
use app\common\model\property\PropertyHead;


/**
 * 拼团活动分类模型
 * Class GroupActivityCategory
 * @package app\common\model\group_activity
 */
class GroupActivityCategory extends BaseModel
{
    use SoftDelete;
    protected $name = 'group_activity_category';
    protected $deleteTime = 'delete_time';

    public function getCreateTimeAttr($value,$data)
    {
        return !empty($data['create_time'])?date('Y-m-d H:i:s',$data['create_time']):'';
    }
    public function getStartTimeAttr($value,$data)
    {
        return !empty($data['start_time'])?date('Y-m-d H:i:s',$data['start_time']):'';
    }
    public function getServiceTimeAttr($value,$data)
    {
        return !empty($data['service_time'])?date('Y-m-d H:i:s',$data['service_time']):'';
    }
    public function propertyHeadInfo()
    {
        return $this->hasOne(PropertyHead::class, 'id', 'property_head_id');
    }
}