ywtc_api/application/activity/model/MoneyTreeLogs.php

45 lines
1.3 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | 海豚PHP框架 [ DolphinPHP ]
// +----------------------------------------------------------------------
// | 版权所有 2016~2019 广东卓锐软件有限公司 [ http://www.zrthink.com ]
// +----------------------------------------------------------------------
// | 官方网站: http://dolphinphp.com
// +----------------------------------------------------------------------
namespace app\activity\model;
use think\Model as ThinkModel;
/**
* 广告模型
* @package app\cms\model
*/
class MoneyTreeLogs extends ThinkModel
{
// 设置当前模型对应的完整数据表名称
protected $name = 'moneytree_logs';
// 自动写入时间戳
protected $autoWriteTimestamp = true;
/**
* 插入金币记录
* @param int $uid 所属用户
* @param int $tree_grade 树等级
* @param int $integral_num 产生的金币
* @author lily<lilyforworks@163.com>
*/
public static function addGetLog($uid,$tree_grade,$integral_num){
$res = self::create([
'uid'=>$uid,
'tree_grade'=>$tree_grade,
'integral_num'=>$integral_num,
'create_time'=>time(),
'update_time'=>time(),
]);
return $res;
}
}