<?php
namespace app\common\model\user;
use app\common\model\BaseModel;
class PointsLog extends BaseModel
{
protected $name = 'user_points_log';
protected $updateTime = false;
public function user()
{
$module = self::getCalledModule() ?: 'common';
return $this->belongsTo("app\\{$module}\\model\\User");
}
public static function add($data)
{
$static = new static;
$static->save(array_merge(['wxapp_id' => $static::$wxapp_id], $data));
}
public function onBatchAdd($saveData)
{
return $this->isUpdate(false)->saveAll($saveData);
}
}