first commit
This commit is contained in:
39
application/common/model/Score.php
Normal file
39
application/common/model/Score.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// +------------------------------------------------+
|
||||
// |http://www.cjango.com |
|
||||
// +------------------------------------------------+
|
||||
// | 修复BUG不是一朝一夕的事情,等我喝醉了再说吧! |
|
||||
// +------------------------------------------------+
|
||||
// | Author: 小陈叔叔 <Jason.Chen> |
|
||||
// +------------------------------------------------+
|
||||
namespace app\common\model;
|
||||
|
||||
class Score extends _Init
|
||||
{
|
||||
/**
|
||||
* 关闭更新时间写入
|
||||
*/
|
||||
protected $updateTime = false;
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo('MemberInfo', 'uid', 'uid');
|
||||
}
|
||||
|
||||
public function getScoreAttr($value, $data)
|
||||
{
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
public function getRulesAttr($value, $data)
|
||||
{
|
||||
$map = ['model' => $data['rule_id']];
|
||||
return ScoreRules::where($map)->find();
|
||||
}
|
||||
|
||||
public function getAddtimeAttr($value, $data)
|
||||
{
|
||||
return date('Y-m-d', $data['create_time']);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user