34 lines
739 B
Plaintext
Executable File
34 lines
739 B
Plaintext
Executable File
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use Illuminate\Support\Facades\File;
|
|
|
|
class tg_comm extends Model
|
|
{
|
|
// 显式指定表名
|
|
protected $table = 'tg_comm';
|
|
|
|
// 可批量赋值的字段
|
|
protected $fillable = [
|
|
'command',
|
|
'Instructions',
|
|
'bot_username',
|
|
'action',
|
|
'memo',
|
|
'dis_play',
|
|
'manager',
|
|
'valid',
|
|
];
|
|
|
|
//将所有的指令转换成数组文字档
|
|
public static function TgComm2Arr(){
|
|
$data = tg_comm::all()->toArray();
|
|
$export = '<?php return ' . var_export($data, true) . ';';
|
|
Storage::disk('dataconfig')->put('tg_comm.php', $export);
|
|
}
|
|
|
|
}
|