|
@@ -9,6 +9,7 @@ use App\Model\Web;
|
|
|
use Hyperf\RpcServer\Annotation\RpcService;
|
|
|
use App\Tools\Result;
|
|
|
use Hyperf\DbConnection\Db;
|
|
|
+use PhpParser\Node\Expr\Clone_;
|
|
|
|
|
|
#[RpcService(name: "FooterService", protocol: "jsonrpc-http", server: "jsonrpc-http")]
|
|
|
class FooterService implements FooterServiceInterface
|
|
@@ -28,13 +29,16 @@ class FooterService implements FooterServiceInterface
|
|
|
array_push($where, ['footer_category.name','like','%'.$data['name'].'%']);
|
|
|
}
|
|
|
$query = FooterCategory::when(!empty($where), function ($query) use ($where) {
|
|
|
- $query->where($where);
|
|
|
+ $query->where($where)
|
|
|
+ ->leftJoin("website","website.id","footer_category.website_id")
|
|
|
+ ->select("footer_category.*","website.website_name","website.id as website_id");
|
|
|
});
|
|
|
- $rep = $query->leftJoin("website","website.id","footer_category.website_id")
|
|
|
- ->select("footer_category.*","website.website_name","website.id as website_id")
|
|
|
+ $count = $query->count();
|
|
|
+ $query = clone $query;
|
|
|
+ $rep = $query
|
|
|
->limit($data['pageSize'])->offset(($data['page']-1)*$data['pageSize'])->orderBy("updated_at","desc")
|
|
|
->get();
|
|
|
- $count = $query->count();
|
|
|
+ // $count = $query->count();
|
|
|
// var_dump($where);
|
|
|
$result = [];
|
|
|
$result = [
|