<?php
namespace Home\Model;

use Think\Model;

header("Content-Type:text/html;CharSet=UTF-8");
class UsersModel extends Model
{
    /**
     * 个人积分账户积分增加
     * @param  string $openid      用户标识
     * @param  int    $plus        赠送积分
     * @return boolean
     */
    public function pointPlus($openid, $plus = 0)
    {
        if ($openid && $plus > 0) {
            $result = $this->where("`openid`='{$openid}'")->setInc("point", $plus);
            return $result;
        } else {
            return false;
        }
    }
}