19
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace app\model;
|
||||
|
||||
use app\model\Base;
|
||||
/**
|
||||
* @property integer $id 主键(ID) - 无注释
|
||||
* @property integer $user_id 用户ID
|
||||
* @property string $content_type 内容类型 enum('text', 'image', 'file', 'video', 'link')
|
||||
* @property string $content 收藏内容本体
|
||||
* @property array $tags 用户自定义标签
|
||||
* @property bool $is_pinned 是否置顶
|
||||
* @property integer $status 状态
|
||||
* @property integer $created_at 创建时间
|
||||
* @property integer $updated_at 更新时间
|
||||
*/
|
||||
class Collection extends Base
|
||||
{
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('User', 'user_id', 'id');//->setEagerlyType(0);
|
||||
}
|
||||
public function setTagsAttr($v)
|
||||
{
|
||||
if(is_array($v)){
|
||||
return implode(',',$v);
|
||||
}
|
||||
return $v;
|
||||
}
|
||||
public function getTagsAttr($v)
|
||||
{
|
||||
if($v && is_string($v)){
|
||||
return explode(',',$v);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function getStatusList(){
|
||||
return [
|
||||
'0' => '兑换中',
|
||||
'1' => '成功',
|
||||
'-1' => '失败',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ use app\model\Base;
|
||||
/**
|
||||
* @property integer $user_id 用户ID
|
||||
* @property integer $direct_total 直推数量
|
||||
* @property integer $vip_total VIP数量
|
||||
* @property integer $team_total 团队成员数量
|
||||
* @property float $consume 消费统计
|
||||
* @property float $sales 销售额
|
||||
|
||||
Reference in New Issue
Block a user