This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
yoshop/source/application/common/model/user/GradeLog.php
2020-04-25 22:20:29 +08:00

36 lines
823 B
PHP

<?php
namespace app\common\model\user;
use app\common\model\BaseModel;
use app\common\enum\user\grade\log\ChangeType as ChangeTypeEnum;
/**
* 用户会员等级变更记录模型
* Class GradeLog
* @package app\common\model\user
*/
class GradeLog extends BaseModel
{
protected $name = 'user_grade_log';
protected $updateTime = false;
/**
* 新增变更记录 (批量)
* @param $data
* @return array|false
* @throws \Exception
*/
public function records($data)
{
$saveData = [];
foreach ($data as $item) {
$saveData[] = array_merge([
'change_type' => ChangeTypeEnum::ADMIN_USER,
'wxapp_id' => static::$wxapp_id
], $item);
}
return $this->isUpdate(false)->saveAll($saveData);
}
}