Properties

$id

$id : integer

Type

integer

$user_id

$user_id : string

Type

string

$title

$title : string

Type

string

$category_id

$category_id : integer

Type

integer

$category_ids

$category_ids : string

Type

string

$label_ids

$label_ids : string

Type

string

$cover_pc

$cover_pc : string

Type

string

$intro

$intro : string

Type

string

$video_intro

$video_intro : integer

Type

integer

$pc_detail_intro

$pc_detail_intro : string

Type

string

$attach_id

$attach_id : integer

Type

integer

$price

$price : float

Type

float

$type

$type : integer

Type

integer

$serial

$serial : integer

Type

integer

$serial_time

$serial_time : string

Type

string

$is_free

$is_free : integer

Type

integer

$vip_free

$vip_free : integer

Type

integer

$status

$status : integer

Type

integer

$video_nums

$video_nums : integer

Type

integer

$duration

$duration : integer

Type

integer

$comment_nums

$comment_nums : integer

Type

integer

$follow_nums

$follow_nums : integer

Type

integer

$learning_nums

$learning_nums : integer

Type

integer

$play_nums

$play_nums : integer

Type

integer

$order

$order : integer

Type

integer

$seo_title

$seo_title : string

Type

string

$seo_keywords

$seo_keywords : string

Type

string

$seo_description

$seo_description : string

Type

string

$created_at

$created_at : \Carbon\Carbon

Type

\Carbon\Carbon

$updated_at

$updated_at : \Carbon\Carbon

Type

\Carbon\Carbon

$deleted_at

$deleted_at : string

Type

string

$table

$table : string

The table associated with the model.

Type

string

$fillable

$fillable : array

The attributes that are mass assignable.

Type

array

$casts

$casts : array

The attributes that should be cast to native types.

Type

array

Methods

getInfo()

getInfo(  $id, boolean  $useCache = true) : \App\Models\BaseModel|\Hyperf\Database\Model\Model|null

getInfo 通过主键id/ids获取信息 User:YM Date:2020/1/8 Time:下午5:55

Parameters

$id
boolean $useCache

是否使用模型缓存

Returns

\App\Models\BaseModel|\Hyperf\Database\Model\Model|null

saveInfo()

saveInfo(  $data, boolean  $type = false) : null

saveInfo 创建/修改记录 User:YM Date:2020/1/8 Time:下午7:49

Parameters

$data

保存数据

boolean $type

是否强制写入,适用于主键是规则生成情况

Returns

null

getInfoByWhere()

getInfoByWhere(  $where, boolean  $type = false) : array

getInfoByWhere 根据条件获取结果 User:YM Date:2020/1/9 Time:下午10:24

Parameters

$where
boolean $type

是否查询多条

Returns

array

deleteInfo()

deleteInfo(  $ids,   $type = 'delete') : integer

deleteInfo 删除/恢复 User:YM Date:2020/2/3 Time:下午8:22

Parameters

$ids

删除的主键ids

$type

Returns

integer

getPagesInfo()

getPagesInfo(  $where = array()) : array

getPagesInfo 获取分页信息,适用于数据量小 数据量过大,可以采用服务层调用,加入缓存 User:YM Date:2020/2/4 Time:下午10:16

Parameters

$where

Returns

array

getCount()

getCount(array  $where = array()) : integer

getCount 根据条件获取总数 User:YM Date:2020/2/4 Time:下午10:16

Parameters

array $where

Returns

integer