resource/app/Services/Tg/Hook/Mod/Option.php
2026-01-21 19:53:48 +08:00

50 lines
1.3 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Services\Tg\Hook\Mod;
use App\Models\Option as ModelOption;
use App\Services\Tg\Hook\Dog;
class Option extends Base {
private $oDog;
public function __construct($aUpdate = [])
{
$this->oDog = new Dog(new ModelOption());
$this->oDog->_setPrimaryKey("k"); // 可选默认id
$this->oDog->_setDogName("option"); // 必须
}
public function __call($sName, $aArg)
{
return $this->oDog->$sName($aArg[0]);
}
// public function Pause($aParam)
// {
// $v = $aParam['aArg'][1];
//
// // 获取第一个匹配的选项
// $oOption = ModelOption::where("type", "pause")->first();
//
// // 检查是否找到了选项
// if ($oOption) {
// $oOption->value = $v;
//
// // 保存并返回结果
// return json_encode($oOption->save());
// }
//
// // 如果没有找到选项,返回一个错误信息
// return json_encode(['error' => 'Option not found']);
// }
//
// public function List()
// {
// $aOptionList = ModelOption::all()->toArray();
//
// return json_encode($aOptionList, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
// }
}