first commit

This commit is contained in:
root
2025-06-18 10:31:43 +08:00
commit d9f820b55d
981 changed files with 449311 additions and 0 deletions

11
app/FormModel/rpc/BaseModel.php Executable file
View File

@ -0,0 +1,11 @@
<?php
namespace App\FormModel\rpc;
class BaseModel
{
protected function getResponse(): BaseResponse
{
return new BaseResponse();
}
}

View File

@ -0,0 +1,43 @@
<?php
namespace App\FormModel\rpc\v1;
use App\Listener\DbQueryExecutedListener;
use App\Model\AppArticle;
use Hyperf\Database\Query\Builder;
use Hyperf\DbConnection\Db;
class RpcIndexModel
{
public function index(): array
{
$res = [];
Db::beforeExecuting(function ($q) {
var_dump($q);
});
$minPublishedTime = strtotime('-1 month');
// $res['shows'] = [];
$res['shows'] = AppArticle::formatQuery(['brand_name'])
->select(['cover', 'aid', 'title', 'brand as brand_name', 'images_count', 'view_count'])
->where([
['module', 0],
['published_status', 1],
['year', '>=', 2022],
['published_at', '>=', $minPublishedTime],
])->orderBy('year', 'DESC')->orderBy('published_at', 'DESC')->limit(25)->get()->toArray();
$res['street'] = AppArticle::formatQuery(['location'])
->select(['cover', 'aid', 'title', 'brand as brand_name', 'images_count', 'view_count', 'location'])
->where([
['module', 1],
['published_status', 1],
['year', '>=', 2022],
['published_at', '>=', $minPublishedTime],
])->orderBy('year', 'DESC')->orderBy('published_at', 'DESC')->limit(25)->get()->toArray();
return $res;
}
}