no message
This commit is contained in:
parent
871252bcac
commit
692a89bae6
@ -14,12 +14,18 @@ final class Coupon extends Base
|
|||||||
|
|
||||||
$aCouponList = UserCoupon::orderBy("name")->get()->toArray();
|
$aCouponList = UserCoupon::orderBy("name")->get()->toArray();
|
||||||
|
|
||||||
|
$aMsg = [];
|
||||||
foreach ($aCouponList as $row) {
|
foreach ($aCouponList as $row) {
|
||||||
$row = $this->ForMat($row);
|
$row = $this->ForMat($row);
|
||||||
$this->oTGHttp->sendToTG(json_encode($row, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
$aMsg[] = $this->toJson($row);
|
||||||
|
// $this->oTGHttp->sendToTG(json_encode($row, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->oHttp::response(200, 'ok');
|
return $aMsg;
|
||||||
|
|
||||||
|
// $this->oHttp::response(200, 'ok');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,11 +55,70 @@ final class Coupon extends Base
|
|||||||
|
|
||||||
public function Like($aParam)
|
public function Like($aParam)
|
||||||
{
|
{
|
||||||
$sFiled = $aParam['aOption'][1];
|
$sFiled = $aParam['aOption'][1] ?? false;
|
||||||
$sLike = $aParam['aArg'][1];
|
$sLike = $aParam['aArg'][1] ?? false;
|
||||||
|
|
||||||
|
if ($sLike == "?") {
|
||||||
|
return "/coupon#like__{field} {like}";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$sFiled) {
|
||||||
|
return "需要field";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$sLike) {
|
||||||
|
return "需要like";
|
||||||
|
}
|
||||||
|
|
||||||
$aCoupon = UserCoupon::where($sFiled, 'like', '%'.$sLike.'%')->get()->toArray();
|
$aCoupon = UserCoupon::where($sFiled, 'like', '%'.$sLike.'%')->get()->toArray();
|
||||||
tomd($aCoupon, 1);
|
|
||||||
|
foreach ($aCoupon as &$aCouponRow) {
|
||||||
|
$aCouponRow = $this->ForMat($aCouponRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->toJson($aCoupon);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function SetJson($aParam)
|
||||||
|
{
|
||||||
|
$iId = $aParam["aOption"][1] ?? false;
|
||||||
|
$aJson = $aParam["aArg"] ?? false;
|
||||||
|
|
||||||
|
if ($aJson == "?") {
|
||||||
|
return "/coupon#setJson__{id} {json}";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$iId) {
|
||||||
|
return "需要id";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$aJson) {
|
||||||
|
return "需要json";
|
||||||
|
}
|
||||||
|
|
||||||
|
$sJson = implode(" ", $aJson);
|
||||||
|
$aJson = json_decode($sJson, true);
|
||||||
|
|
||||||
|
$oCoupon = UserCoupon::find($iId);
|
||||||
|
|
||||||
|
if (!$oCoupon) {
|
||||||
|
return "没找到这个id";
|
||||||
|
}
|
||||||
|
|
||||||
|
$oCoupon->id = $aJson["id"];
|
||||||
|
$oCoupon->name = $aJson["name"];
|
||||||
|
$oCoupon->code = $aJson["code"];
|
||||||
|
$oCoupon->content = json_encode($aJson["content"]);
|
||||||
|
$oCoupon->limit = json_encode($aJson["limit"]);
|
||||||
|
$oCoupon->create_time = $aJson["create_time"];
|
||||||
|
$oCoupon->expire_time = $aJson["expire_time"];
|
||||||
|
$oCoupon->front_show = $aJson["front_show"];
|
||||||
|
$oCoupon->save();
|
||||||
|
|
||||||
|
|
||||||
|
$aParam["aArg"][1] = $oCoupon->id;
|
||||||
|
|
||||||
|
return $this->FindById($aParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function Set($aParam)
|
public function Set($aParam)
|
||||||
@ -113,8 +178,8 @@ final class Coupon extends Base
|
|||||||
|
|
||||||
$aCoupon['content'] = json_decode($aCoupon['content'], 1);
|
$aCoupon['content'] = json_decode($aCoupon['content'], 1);
|
||||||
$aCoupon['limit'] = json_decode($aCoupon['limit'], 1);
|
$aCoupon['limit'] = json_decode($aCoupon['limit'], 1);
|
||||||
$aCoupon['limit']['use_time'] = $aCoupon['limit']['use_time'] ? date("Y-m-d H:i:s", $aCoupon['limit']['use_time']) : false;
|
// $aCoupon['limit']['use_time'] = $aCoupon['limit']['use_time'] ? date("Y-m-d H:i:s", $aCoupon['limit']['use_time']) : false;
|
||||||
$aCoupon['limit']['total_use_time'] = $aCoupon['limit']['total_use_time'] ? date("Y-m-d H:i:s", $aCoupon['limit']['total_use_time']) : false;
|
// $aCoupon['limit']['total_use_time'] = $aCoupon['limit']['total_use_time'] ? date("Y-m-d H:i:s", $aCoupon['limit']['total_use_time']) : false;
|
||||||
$aCoupon['create_time'] = date("Y-m-d H:i:s", $aCoupon['create_time']);
|
$aCoupon['create_time'] = date("Y-m-d H:i:s", $aCoupon['create_time']);
|
||||||
$aCoupon['expire_time'] = date("Y-m-d H:i:s", $aCoupon['expire_time']);
|
$aCoupon['expire_time'] = date("Y-m-d H:i:s", $aCoupon['expire_time']);
|
||||||
|
|
||||||
|
|||||||
@ -272,11 +272,11 @@ final class Mail extends Base
|
|||||||
|
|
||||||
public function tmp()
|
public function tmp()
|
||||||
{
|
{
|
||||||
$subject = "福云 - 暑假礼盒";
|
$subject = "福云 - 暑期礼盒";
|
||||||
|
|
||||||
// $text = "<br>原主域名fuuu.cloud被封禁,已更换为fuuuu.cloud(多了一个u)。<br><br>无法继续翻墙的用户需到网站上重新复制订阅。<br><br>很抱歉对您的使用造成影响,补偿有套餐用户30g流量。";
|
// $text = "<br>原主域名fuuu.cloud被封禁,已更换为fuuuu.cloud(多了一个u)。<br><br>无法继续翻墙的用户需到网站上重新复制订阅。<br><br>很抱歉对您的使用造成影响,补偿有套餐用户30g流量。";
|
||||||
// $text = "<br>近期管控收紧,造成节点波动和不可用。已陆续恢复正常,补偿有套餐用户10g流量。<br><br>最新域名:fuuuu.cloud";
|
// $text = "<br>近期管控收紧,造成节点波动和不可用。已陆续恢复正常,补偿有套餐用户10g流量。<br><br>最新域名:fuuuu.cloud";
|
||||||
$text = "<br>礼盒内容:<br>一批6折优惠码:zzxxss,仅限购买月套餐<br>10g流量,赠送给有套餐用户。<br>富云最新域名fuuuu.cloud";
|
$text = "<br>礼盒内容:<br>一批6折优惠码:shuqi25,仅限购买月套餐。<br>10g流量,自动发送给有套餐用户。<br>福云最新域名fuuuu.cloud。";
|
||||||
|
|
||||||
$content = strip_tags(
|
$content = strip_tags(
|
||||||
str_replace(
|
str_replace(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user