no message
This commit is contained in:
parent
5e1b09fc29
commit
7bf8e81584
42
src/Services/Tg/Helper.php
Normal file
42
src/Services/Tg/Helper.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Tg;
|
||||||
|
//use App\Models\Config;
|
||||||
|
//use App\Services\IM\Telegram;
|
||||||
|
//use App\Services\Tg\Http;
|
||||||
|
|
||||||
|
class Helper {
|
||||||
|
|
||||||
|
private static function _valueFormat($sValueTmp)
|
||||||
|
{
|
||||||
|
if (!$sValueTmp) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
list($sValue, $sValueType) = explode("#", $sValueTmp);
|
||||||
|
|
||||||
|
// 没有 #xx 直接返回原本value
|
||||||
|
if (!$sValueType) {
|
||||||
|
return $sValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($sValueType) {
|
||||||
|
case "int":
|
||||||
|
$sValue = (int) $sValue;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break:
|
||||||
|
}
|
||||||
|
|
||||||
|
return $sValue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function valueFormat($sValue)
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->_valueFormat($sValue);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -8,6 +8,7 @@ use App\Models\Node as ModelNode;
|
|||||||
use App\Utils\Tools;
|
use App\Utils\Tools;
|
||||||
//use App\Services\DB;
|
//use App\Services\DB;
|
||||||
use App\Services\TomTool\Http;
|
use App\Services\TomTool\Http;
|
||||||
|
use App\Services\Tg\Helper;
|
||||||
|
|
||||||
class Node extends Base
|
class Node extends Base
|
||||||
{
|
{
|
||||||
@ -179,6 +180,8 @@ class Node extends Base
|
|||||||
return "需要to";
|
return "需要to";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sValue = Helper::valueFormat($sValue);
|
||||||
|
|
||||||
$oNodeNow = ModelNode::where($sField, $sValue)->get();
|
$oNodeNow = ModelNode::where($sField, $sValue)->get();
|
||||||
|
|
||||||
if ($oNodeNow->isEmpty()) {
|
if ($oNodeNow->isEmpty()) {
|
||||||
@ -287,5 +290,9 @@ class Node extends Base
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// private function _valueFormat()
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user