no message
This commit is contained in:
parent
8b582b46c9
commit
7d43e1030e
@ -8,6 +8,7 @@
|
|||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use App\Services\TomTool\Telegram\Slave as TeleSlave;
|
use App\Services\TomTool\Telegram\Slave as TeleSlave;
|
||||||
use App\Services\TomTool\Flow;
|
use App\Services\TomTool\Flow;
|
||||||
|
use App\Models\ArticleKeyAuthorMap;
|
||||||
|
|
||||||
class GetController extends Controller
|
class GetController extends Controller
|
||||||
{
|
{
|
||||||
@ -41,9 +42,14 @@ public function urlbySubKey(Request $oRequest)
|
|||||||
private function findValidUrlBySubKey($sSubKey, $iNum, $oFlow)
|
private function findValidUrlBySubKey($sSubKey, $iNum, $oFlow)
|
||||||
{
|
{
|
||||||
try {
|
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("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"); // 要这样吗
|
// $oQuery = ModelArticles::where("aOpt", "like", '%'.$sSubKey.'%')->orderBy("id", "asc"); // 要这样吗
|
||||||
$iTotal = $oQuery->count();
|
$iTotal = $oQuery->count();
|
||||||
|
|
||||||
if ($iTotal === 0) throw new \Exception("subkey:{$sSubKey} 旗下无任何记录");
|
if ($iTotal === 0) throw new \Exception("subkey:{$sSubKey} 旗下无任何记录");
|
||||||
|
|||||||
43
app/Models/ArticleKeyAthorMap.php
Executable file
43
app/Models/ArticleKeyAthorMap.php
Executable 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');
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user