no message

This commit is contained in:
hellcat 2026-07-28 20:28:37 +08:00
parent 8b582b46c9
commit 7d43e1030e
2 changed files with 50 additions and 1 deletions

View File

@ -8,6 +8,7 @@
use Illuminate\Support\Facades\Storage;
use App\Services\TomTool\Telegram\Slave as TeleSlave;
use App\Services\TomTool\Flow;
use App\Models\ArticleKeyAuthorMap;
class GetController extends Controller
{
@ -41,9 +42,14 @@ public function urlbySubKey(Request $oRequest)
private function findValidUrlBySubKey($sSubKey, $iNum, $oFlow)
{
try {
$sAuthors = ArticleKeyAuthorMap::where("key", $sSubKey)->first()?->authors;
$aAuthors = json_decode($sAuthors, true);
$oQuery = ModelArticles::whereIn("sAuthorCode", $aAuthors)->->orderBy("id", "asc");
// $oQuery = ArticleKeyAuthorMap::where("key", $sSubKey)->first()?->authors;
// $oQuery = ModelArticles::where("sAuthorCode", $sAuthorCode)->orderBy("id", "asc");
// $oQuery = ModelArticles::where("aOpt", "like", $sSubKey)->orderBy("id", "asc");
$oQuery = ModelArticles::where("aOpt", "like", '%'.$sSubKey.'%')->orderBy("id", "asc"); // 要这样吗
// $oQuery = ModelArticles::where("aOpt", "like", '%'.$sSubKey.'%')->orderBy("id", "asc"); // 要这样吗
$iTotal = $oQuery->count();
if ($iTotal === 0) throw new \Exception("subkey:{$sSubKey} 旗下无任何记录");

View File

@ -0,0 +1,43 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
//use Illuminate\Database\Eloquent\Relations\MorphTo;
//use Illuminate\Database\Eloquent\Relations\MorphMany;
class ArticleKeyAuthorMap extends Model
{
protected $table = 'article_key_author_map';
public $timestamps = false;
// protected $guarded = [];
// protected function casts(): array
// {
// return [
// 'aOpt' => 'array',
// 'aSchemaPro' => 'array',
// ];
// }// 我希望查询的时候忽略这个设置
// protected static function booted(): void
// {
// static::deleting(function ($oArticle) {
// $oArticle->oImages()->get()->each(function ($oImage) {
// $oImage->delete();
// });
// });
// }
//
// public function oSubject(): MorphTo
// {
// return $this->morphTo('oSubject');
// }
//
// public function oImages(): MorphMany
// {
// return $this->morphMany(UploadImages::class, 'oImageable');
// }
}