'银行卡充值', self::TYPE_WXCHANGE=>'微信零钱充值' ]; const STATUS_PAY = 1; const STATUS_UNPAY = 2; const STATUS_ERROR = 3; const STATUSS = [ self::STATUS_PAY=>'已充值', self::STATUS_UNPAY=>'没有支付', self::STATUS_ERROR=>'充值失败', ]; public function user() { return $this->belongsTo('user', 'userID'); } public function setMoneyAttr($value) { return $value * 100; } public function getMoneyAttr($value) { return Common::price2($value / 100); } public function getResultTimeAttr($value) { return Common::timetodate($value, 4); } public function getOuterReachTimeAttr($value) { return Common::timetodate($value, 4); } public function getTypeNameAttr($value, $data) { return self::TYPES[$data['type']]; } public function getStatusTextAttr($value, $data) { return self::STATUSS[$data['status']]; } public function createAlias($id) { return 'RC' . Common::timetodate(THINK_START_TIME, 10) . sprintf("%08d", $id); } }