123456789101112131415161718192021222324252627 |
- <?php
- /**
- * 用户余额组相关
- * @author benzhan
- */
- class UserBalance extends Model {
- protected $tableName = 'user_balance';
- protected $dbKey = 'dw_chat_user';
- /**
- * 增加余额
- * @param $user_id
- * @param $amount
- */
- public function incr($user_id, $token_id, $amount) {
- $count = $this->objTable->getCount(compact('user_id'));
- if (!$count) {
- $data = compact('user_id', 'token_id');
- $data['create_time'] = $data['update_time'] = date('Y-m-d H:i:s');
- $this->objTable->addObjectNx2($data);
- }
- }
- }
|