\App\ModelsUserCourse

Summary

Methods
Properties
Constants
getInfo()
saveInfo()
getInfoByWhere()
deleteInfo()
getPagesInfo()
getCount()
$id
$user_id
$course_id
$created_at
$updated_at
No constants found
No protected methods found
$table
$fillable
$casts
N/A
No private methods found
No private properties found
N/A

Properties

$id

$id : integer

Type

integer

$user_id

$user_id : string

Type

string

$course_id

$course_id : integer

Type

integer

$created_at

$created_at : \Carbon\Carbon

Type

\Carbon\Carbon

$updated_at

$updated_at : \Carbon\Carbon

Type

\Carbon\Carbon

$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