1
0

first commit

This commit is contained in:
2020-08-06 14:58:51 +08:00
commit 17096657dc
780 changed files with 92857 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
<?php
// +------------------------------------------------+
// |http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace app\common\model;
use tools\Str;
class VipOrder extends _Init
{
/**
* 模型初始化【事件注册】
*/
protected static function init()
{
self::beforeInsert(function ($data) {
$data->orderid = Str::orderid('VIP');
});
}
public function getStatusAttr($value)
{
switch ($value) {
case '0':
return '<span style="color:red">未支付</span>';
break;
case '20':
return '<span style="color:green">已支付</span>';
break;
default:
break;
}
}
public function getModelAttr($value, $data)
{
if ($data['model'] == 'weixin') {
return '微信支付';
} else if ($data['model'] == 'score') {
return '积分兑换';
} else {
return '未知';
}
}
public function user()
{
return $this->belongsTo('MemberInfo', 'uid', 'uid');
}
}