newQuery(); } /** * 调用魔术方法 * @param string $method 方法名称 * @param array $args 调用参数 * @return $this|false|mixed */ public function __call($method, $args) { $oplogs = [ 'onAdminSave' => "修改%s[%s]状态", 'onAdminUpdate' => "更新%s[%s]记录", 'onAdminInsert' => "增加%s[%s]成功", "onAdminDelete" => "删除%s[%s]成功", ]; if (isset($oplogs[$method])) { if ($this->oplogType && $this->oplogName) { $changeIds = $args[0] ?? ''; if (is_callable(static::$oplogCall)) { $changeIds = call_user_func(static::$oplogCall, $method, $changeIds, $this); } sysoplog($this->oplogType, lang($oplogs[$method], [lang($this->oplogName), $changeIds])); } return $this; } else { return parent::__call($method, $args); } } /** * 静态魔术方法 * @param string $method 方法名称 * @param array $args 调用参数 * @return mixed|false|integer|QueryHelper */ public static function __callStatic($method, $args) { return QueryHelper::make(static::class, $method, $args, function ($method, $args) { return parent::__callStatic($method, $args); }); } }