no message
This commit is contained in:
parent
7756568302
commit
8dd9eb5efd
48
app/Http/Controllers/Api/GithubController.php
Executable file
48
app/Http/Controllers/Api/GithubController.php
Executable file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
//use App\Models\Book as ModelBook;
|
||||
//use App\Models\BookOption as ModelBookOption;
|
||||
//use App\Services\TomTool\Http;
|
||||
use App\Models\GoodPool as ModelGoodPool;
|
||||
|
||||
class GithubController
|
||||
{
|
||||
|
||||
private function echo($zz){
|
||||
return $zz;
|
||||
}
|
||||
|
||||
private function eval($sEval)
|
||||
{
|
||||
return eval("return ".$sEval);
|
||||
}
|
||||
|
||||
private function date($date)
|
||||
{
|
||||
return date($date);
|
||||
}
|
||||
|
||||
private function goodToStr($sGood)
|
||||
{
|
||||
$aGood = json_decode($sGood, true);
|
||||
|
||||
$sGoodStr = "";
|
||||
$i = 0;
|
||||
foreach ($aGood as $row) {
|
||||
if ($i !== 0) {
|
||||
$sGoodStr .= "
|
||||
|
||||
";
|
||||
}
|
||||
$sGoodStr .= $row;
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $sGoodStr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
20
app/Http/Controllers/Api/GoodController.php
Executable file
20
app/Http/Controllers/Api/GoodController.php
Executable file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
//use App\Models\Book as ModelBook;
|
||||
//use App\Models\BookOption as ModelBookOption;
|
||||
//use App\Services\TomTool\Http;
|
||||
use App\Models\GoodPool as ModelGoodPool;
|
||||
|
||||
class GoodController
|
||||
{
|
||||
|
||||
// public function rand($sClass)
|
||||
// {
|
||||
// $oGood = ModelGoodPool::_all();
|
||||
//
|
||||
// tomd($oGood, 1);
|
||||
// }
|
||||
|
||||
}
|
||||
80
app/Http/Controllers/CmdController.php
Executable file
80
app/Http/Controllers/CmdController.php
Executable file
@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
//use Illuminate\Http\Request;
|
||||
//use App\Models\ArticleList;
|
||||
//use App\Services\Time;
|
||||
//use voku\helper\AntiXSS;
|
||||
//use App\Models\Tags;
|
||||
//use App\Services\TomTool\Http;
|
||||
use App\Models\Book as ModelBook;
|
||||
use App\Models\BookOption as ModelBookOption;
|
||||
use App\Services\TG\Http as TGHttp;
|
||||
|
||||
class CronController
|
||||
{
|
||||
public $oTGHttp;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->oTGHttp = new TGHttp();
|
||||
$this->oTGHttp->sApiToken = env('telegram_token');
|
||||
$this->oTGHttp->sApiChatId = env('telegram_chatid');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$h = date("H");
|
||||
$i = date("i");
|
||||
$s = date("s");
|
||||
|
||||
//// test
|
||||
$k = $_GET["k"] ?? false;
|
||||
$v = $_GET["v"] ?? false;
|
||||
|
||||
if ($k == "h") {
|
||||
$h = $v;
|
||||
} else if ($k == "i") {
|
||||
$i = $v;
|
||||
} else if ($k == "k") {
|
||||
$s = $v;
|
||||
}
|
||||
|
||||
// $h = "00";
|
||||
//// test end
|
||||
|
||||
if ($h == "00" && $i== "00") {
|
||||
|
||||
$iFireWarningLine = ModelBookOption::_hit("fire_warning_line");
|
||||
|
||||
$sDateWarningLine = date("Y-m-d H:i:s", strtotime($iFireWarningLine."day"));
|
||||
$oBook = ModelBook::whereDate("fire", "<=", $sDateWarningLine)->where("fire_close", 0)->get();
|
||||
|
||||
if (!$oBook->isEmpty()) {
|
||||
|
||||
$oDateNow = new \DateTime();
|
||||
|
||||
foreach ($oBook as $oBookRow) {
|
||||
|
||||
$oDateRag = new \DateTime($oBookRow->fire);
|
||||
|
||||
$iDiffDay = $oDateNow->diff($oDateRag)->days;
|
||||
|
||||
if ($oDateNow > $oDateRag) {
|
||||
$iDiffDay = -$iDiffDay;
|
||||
}
|
||||
|
||||
$sTgStr = "⚠️⚠️⚠️ {{ ".$oBookRow->rag." }} 还有 {{ ".$iDiffDay." }} 天到期 ⚠️⚠️⚠️";
|
||||
|
||||
$this->oTGHttp->sendToTG($sTgStr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
18
app/Http/Controllers/GoodController.php
Executable file
18
app/Http/Controllers/GoodController.php
Executable file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
//use App\Models\Book as ModelBook;
|
||||
//use App\Models\BookOption as ModelBookOption;
|
||||
//use App\Services\TomTool\Http;
|
||||
//use App\Models\DoveSite as ModelDoveSite;
|
||||
|
||||
class GoodController
|
||||
{
|
||||
|
||||
public function rand($sClass)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
21
app/Models/Blade.php
Executable file
21
app/Models/Blade.php
Executable file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Blade extends Model
|
||||
{
|
||||
protected $table = 'blade';
|
||||
|
||||
public static function _listKey()
|
||||
{
|
||||
$aSelf = self::all()->toArray();
|
||||
|
||||
foreach ($aSelf as &$aSelfRow) {
|
||||
unset($aSelfRow["content"]);
|
||||
}
|
||||
|
||||
return $aSelf;
|
||||
}
|
||||
}
|
||||
22
app/Models/BladeJctj.php
Executable file
22
app/Models/BladeJctj.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Jctj extends Model
|
||||
{
|
||||
protected $table = 'jctj';
|
||||
public $timestamps = false;
|
||||
|
||||
// public static function _listKey()
|
||||
// {
|
||||
// $aSelf = self::all()->toArray();
|
||||
//
|
||||
// foreach ($aSelf as &$aSelfRow) {
|
||||
// unset($aSelfRow["content"]);
|
||||
// }
|
||||
//
|
||||
// return $aSelf;
|
||||
// }
|
||||
}
|
||||
22
app/Models/BladeJctjOption.php
Executable file
22
app/Models/BladeJctjOption.php
Executable file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class BladeJctj extends Model
|
||||
{
|
||||
protected $table = 'blade_jctj';
|
||||
public $timestamps = false;
|
||||
|
||||
// public static function _listKey()
|
||||
// {
|
||||
// $aSelf = self::all()->toArray();
|
||||
//
|
||||
// foreach ($aSelf as &$aSelfRow) {
|
||||
// unset($aSelfRow["content"]);
|
||||
// }
|
||||
//
|
||||
// return $aSelf;
|
||||
// }
|
||||
}
|
||||
19
app/Models/GoodPool.php
Executable file
19
app/Models/GoodPool.php
Executable file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Ship extends Model
|
||||
{
|
||||
protected $table = 'ship';
|
||||
public $timestamps = false;
|
||||
|
||||
public static function _find($sCode)
|
||||
{
|
||||
$oSelf = self::where("code", $sCode)->first();
|
||||
|
||||
return $oSelf;
|
||||
}
|
||||
|
||||
}
|
||||
64
app/Models/Me.php
Executable file
64
app/Models/Me.php
Executable file
@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class GoodPool extends Model
|
||||
{
|
||||
protected $table = 'good_pool';
|
||||
public $timestamps = false;
|
||||
|
||||
// public static function _find($sCode)
|
||||
// {
|
||||
// $oSelf = self::where("code", $sCode)->first();
|
||||
//
|
||||
// return $oSelf;
|
||||
// }
|
||||
|
||||
public static function _all()
|
||||
{
|
||||
$oSelf = self::all();
|
||||
|
||||
// $oNew;
|
||||
foreach ($oSelf as &$oSelfRow) {
|
||||
$oSelfRow->good = json_decode($oSelfRow->good);
|
||||
}
|
||||
|
||||
return $oSelf;
|
||||
}
|
||||
|
||||
public static function _rand($sClass)
|
||||
{
|
||||
$aGood = self::where("class", $sClass)->get()->toArray();
|
||||
|
||||
$iGoodRandKey = array_rand($aGood);
|
||||
|
||||
$aGoodRand = $aGood[$iGoodRandKey];
|
||||
|
||||
return $aGoodRand;
|
||||
}
|
||||
|
||||
public static function _goodToGithub($sGood, $bEnter = true)
|
||||
{
|
||||
$aGood = json_decode($sGood);
|
||||
|
||||
$str = "";
|
||||
$i = 0;
|
||||
foreach ($aGood as $sGoodRow) {
|
||||
if ($i !== 0) {
|
||||
$str .= "
|
||||
";
|
||||
if ($bEnter == true) {
|
||||
$str .= "
|
||||
";
|
||||
}
|
||||
}
|
||||
$str .= $sGoodRow;
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
}
|
||||
69
app/Services/TG/Hook/Mod/Blade.php
Normal file
69
app/Services/TG/Hook/Mod/Blade.php
Normal file
@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\TG\Hook\Mod;
|
||||
use App\Models\Blade as ModelBlade;
|
||||
|
||||
class Blade extends Base {
|
||||
|
||||
private function filter($oBlade)
|
||||
{
|
||||
foreach ($oBlade as &$oBladeRow) {
|
||||
unset($oBladeRow->content);
|
||||
unset($oBladeRow->id);
|
||||
}
|
||||
|
||||
return $oBlade;
|
||||
}
|
||||
|
||||
public function List()
|
||||
{
|
||||
$oBlade = ModelBlade::all();
|
||||
$oBlade = $this->filter($oBlade);
|
||||
|
||||
return $this->toJson($oBlade);
|
||||
}
|
||||
|
||||
public function Find($aParam)
|
||||
{
|
||||
$sField = $aParam["aOption"][1] ?? "id";
|
||||
$sValue = $aParam["aArg"][1] ?? false;
|
||||
|
||||
if ($sValue == "?") {
|
||||
return "/blade#find__{field?} {value}";
|
||||
}
|
||||
|
||||
$oBlade = ModelBlade::where($sField, $sValue)->first();
|
||||
|
||||
return $oBlade->content;
|
||||
}
|
||||
|
||||
public function Like($aParam)
|
||||
{
|
||||
$sField = $aParam["aOption"][1] ?? false;
|
||||
$sValue = $aParam["aArg"][1] ?? false;
|
||||
|
||||
if ($sValue == "?") {
|
||||
return "/blade#like__{field} {value}";
|
||||
}
|
||||
|
||||
if (!$sField) {
|
||||
return "需要field";
|
||||
}
|
||||
|
||||
if (!$sValue) {
|
||||
return "需要value";
|
||||
}
|
||||
|
||||
$oBlade = ModelBlade::where($sField, "like", "%".$sValue."%")->get();
|
||||
|
||||
$oBlade = $this->filter($oBlade);
|
||||
|
||||
return $this->toJson($oBlade);
|
||||
}
|
||||
|
||||
public function Del($aParam)
|
||||
{
|
||||
$sCode = $aParam["aArg"][]
|
||||
}
|
||||
|
||||
}
|
||||
35
app/Services/TG/Hook/Mod/DDT.php
Normal file
35
app/Services/TG/Hook/Mod/DDT.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\TG\Hook\Mod;
|
||||
|
||||
//use App\Models\GoodPool as ModelGoodPool;
|
||||
//use App\Services\TomTool\Http;
|
||||
//use App\Models\BladeJctj as ModelBladeJctj;
|
||||
|
||||
class Common extends Base {
|
||||
|
||||
public $oModelSelf;
|
||||
|
||||
public function __construct($oModelSelf)
|
||||
{
|
||||
|
||||
// $this->oModelSelf = $oModelSelf;
|
||||
$this->_setModel($oModelSelf);
|
||||
|
||||
}
|
||||
|
||||
public function _setModel($oModelSelf)
|
||||
{
|
||||
$this->oModelSelf = $oModelSelf;
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
// $oJctj = ModelBladeJctj::all();
|
||||
|
||||
$oSelf = $this->oModelSelf->all();
|
||||
|
||||
tomd($oSelf, 1);
|
||||
}
|
||||
|
||||
}
|
||||
108
app/Services/TG/Hook/Mod/Good.php
Normal file
108
app/Services/TG/Hook/Mod/Good.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\TG\Hook\Mod;
|
||||
|
||||
use App\Models\Ship as ModelShip;
|
||||
//use App\Services\TomTool\Http;
|
||||
|
||||
class Ship extends Base {
|
||||
|
||||
public function List()
|
||||
{
|
||||
|
||||
$oShip = ModelShip::all();
|
||||
|
||||
foreach ($oShip as $oShipRow) {
|
||||
$oShipRow->good = json_decode($oShipRow->good, true);
|
||||
}
|
||||
|
||||
return $this->toJson($oShip);
|
||||
|
||||
}
|
||||
|
||||
public function Find($aParam)
|
||||
{
|
||||
|
||||
$sCode = $aParam["aArg"][1] ?? false;
|
||||
|
||||
if (!$sCode) {
|
||||
return "需要code";
|
||||
}
|
||||
|
||||
$oShip = ModelShip::_find($sCode);
|
||||
|
||||
if (!$oShip) {
|
||||
return "没找到这个";
|
||||
}
|
||||
|
||||
$oShip->good = json_decode($oShip->good);
|
||||
|
||||
return $this->toJson($oShip);
|
||||
}
|
||||
|
||||
public function Add($aParam)
|
||||
{
|
||||
$sCode = $aParam["aArg"][1] ?? false;
|
||||
|
||||
if (!$sCode) {
|
||||
return "需要code";
|
||||
}
|
||||
|
||||
$oShip = new ModelShip();
|
||||
$oShip->code = $sCode;
|
||||
$oShip->save();
|
||||
|
||||
return $this->toJson($oShip);
|
||||
}
|
||||
|
||||
public function Set($aParam)
|
||||
{
|
||||
$sCode = $aParam["aOption"][1] ?? false;
|
||||
$sField = $aParam["aOption"][2] ?? false;
|
||||
// $sValue = $aParam["aArg"][1] ?? false;
|
||||
$aValue = $aParam["aArg"] ?? false;
|
||||
|
||||
$sValue = implode(" ", $aValue);
|
||||
|
||||
if (!$sCode) {
|
||||
return "需要code";
|
||||
}
|
||||
|
||||
if (!$sField) {
|
||||
return "需要field";
|
||||
}
|
||||
|
||||
if (!$sValue) {
|
||||
return "需要value";
|
||||
}
|
||||
|
||||
$oShip = ModelShip::_find($sCode);
|
||||
|
||||
if (!$oShip) {
|
||||
return "没找到";
|
||||
}
|
||||
|
||||
$oShip->$sField = $sValue;
|
||||
$oShip->save();
|
||||
|
||||
// return $this->toJson($oShip);
|
||||
|
||||
$aParam["aArg"][1] = $oShip->code;
|
||||
|
||||
return $this->Find($aParam);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//[
|
||||
// "* 好好 - 就是好",
|
||||
// "* 不好不好 - 就是不好"
|
||||
//]
|
||||
|
||||
//[
|
||||
// "* 好好 - 就是好",
|
||||
// "* 不好不好 - 就是不好",
|
||||
// "* 你就是个瘠薄 - 知道不",
|
||||
// "* 去死吧 - 去死"
|
||||
//]
|
||||
16
app/Services/TG/Hook/Mod/Jctj.php
Normal file
16
app/Services/TG/Hook/Mod/Jctj.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\TG\Hook\Mod;
|
||||
|
||||
//use App\Models\GoodPool as ModelGoodPool;
|
||||
//use App\Services\TomTool\Http;
|
||||
use App\Services\BladeJctj as ModelBladeJctj;
|
||||
|
||||
class Jctj extends Base {
|
||||
|
||||
public function list()
|
||||
{
|
||||
$j
|
||||
}
|
||||
|
||||
}
|
||||
31
app/Services/TG/Hook/Mod/JctjOption.php
Normal file
31
app/Services/TG/Hook/Mod/JctjOption.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\TG\Hook\Mod;
|
||||
|
||||
use App\Models\BladeJctj as ModelBladeJctj;
|
||||
use App\Services\TG\Hook\Mod\DDT;
|
||||
|
||||
|
||||
class Jctj extends Base {
|
||||
|
||||
private $oDDT;
|
||||
private $aUpdate;
|
||||
|
||||
public function __construct($aUpdate)
|
||||
{
|
||||
|
||||
$this->aUpdate = $aUpdate;
|
||||
$this->oDDT = new DDT(new ModelBladeJctj());
|
||||
$this->oDDT->_setPrimaryKey("id");
|
||||
$this->oDDT->_setStrField(["content"]);
|
||||
|
||||
}
|
||||
|
||||
public function __call($sName, $aArg)
|
||||
{
|
||||
|
||||
return $this->oDDT->$sName($aArg[0]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
0
public/js/jquery.min.js
vendored
Normal file
0
public/js/jquery.min.js
vendored
Normal file
1
resources/views/cmd.blade.php
Normal file
1
resources/views/cmd.blade.php
Normal file
@ -0,0 +1 @@
|
||||
sdfsd
|
||||
1
resources/views/cmd/cmd.blade.php
Normal file
1
resources/views/cmd/cmd.blade.php
Normal file
@ -0,0 +1 @@
|
||||
sdfsd
|
||||
5
resources/views/cmd/image/upload.blade.php
Normal file
5
resources/views/cmd/image/upload.blade.php
Normal file
@ -0,0 +1,5 @@
|
||||
<form action="upload.php" method="post" enctype="multipart/form-data">
|
||||
<label for="file">选择图片:</label>
|
||||
<input type="file" name="file" id="file" accept="image/*" required>
|
||||
<input type="submit" value="上传">
|
||||
</form>
|
||||
0
resources/views/cmd/imageUplode.blade
Normal file
0
resources/views/cmd/imageUplode.blade
Normal file
Loading…
Reference in New Issue
Block a user