Files
tuiguangzhushou/application/common/model/AccountLogs.php
2020-08-06 15:26:41 +08:00

67 lines
1.6 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\common\model;
class AccountLogs extends _Init
{
/**
* 关闭更新时间写入
*/
protected $updateTime = false;
public function getTypeTextAttr($value, $data)
{
return Config::getValue($data['type'], 'account_type');
}
protected function getCreateTimeAttr($value)
{
return date('Y-m-d', $value);
}
protected function getIncreaseFormartAttr($value, $data)
{
if ($data['increase'] > 0) {
return '+' . $data['increase'];
} else {
return $data['increase'];
}
}
protected function getFreezTextAttr($value, $data)
{
switch ($data['freezing']) {
case 0:
return '发放';
break;
case 1:
return '未发放';
break;
default:
return '错误';
break;
}
}
protected function user()
{
return $this->hasOne('Member', 'id', 'uid');
}
protected function rules()
{
return $this->belongsTo('AccountRules', 'rule_id');
}
protected function fuser()
{
return $this->hasOne('Member', 'id', 'fromuser');
}
}