}
public function detail()
{
$id = $this->request->param('id');
$products = Cache::get('product');
if (isset($products[$id])) {
$one = $products[$id];
} else {
throw new HttpException(404);
}
$product = \app\common\model\Product::with(['tags'=>['products'=>function($q){$q->where('state', 1)->order('id', 'desc')->limit(3);}, 'samples'=>function($q){$q->order('id', 'desc')->limit(3);}]])->find($id)->toArray();
$tags = $product['tags'];
// 相关产品
$rel_products = array_column($tags, 'products');
$rel_products = array_reduce($rel_products, function ($carry, $item){
return array_merge($carry, $item);
USER | www |
HOME | /home/www |
PATH_TRANSLATED | redirect:/index.php/product/27.html/27.html |
PATH_INFO | /product/27.html |
SCRIPT_NAME | /index.php |
REQUEST_URI | /product/27.html |
QUERY_STRING | |
REQUEST_METHOD | GET |
SERVER_PROTOCOL | HTTP/2.0 |
GATEWAY_INTERFACE | CGI/1.1 |
REDIRECT_URL | /product/27.html |
REMOTE_PORT | 45420 |
SCRIPT_FILENAME | /www/wwwroot/datu_web1/public/index.php |
SERVER_ADMIN | webmasterexample.com |
CONTEXT_DOCUMENT_ROOT | /www/wwwroot/datu_web1/public |
CONTEXT_PREFIX | |
REQUEST_SCHEME | https |
DOCUMENT_ROOT | /www/wwwroot/datu_web1/public |
REMOTE_ADDR | 35.175.212.5 |
SERVER_PORT | 443 |
SERVER_ADDR | 172.17.112.226 |
SERVER_NAME | www.datolaser.com |
SERVER_SOFTWARE | Apache |
SERVER_SIGNATURE | <address>Apache Server at www.datolaser.com Port 443</address> |
LD_LIBRARY_PATH | /www/server/apache/lib |
PATH | /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin |
HTTP_HOST | www.datolaser.com |
HTTP_USER_AGENT | claudebot |
HTTP_ACCEPT | */* |
proxy-nokeepalive | 1 |
H2_STREAM_TAG | 000 |
H2_STREAM_ID | |
H2_PUSHED_ON | |
H2_PUSHED | |
H2_PUSH | off |
H2PUSH | off |
HTTP2 | on |
SSL_TLS_SNI | www.datolaser.com |
HTTPS | on |
REDIRECT_STATUS | 200 |
REDIRECT_H2_STREAM_TAG | 000 |
REDIRECT_H2_STREAM_ID | |
REDIRECT_H2_PUSHED_ON | |
REDIRECT_H2_PUSHED | |
REDIRECT_H2_PUSH | off |
REDIRECT_H2PUSH | off |
REDIRECT_HTTP2 | on |
REDIRECT_SSL_TLS_SNI | www.datolaser.com |
REDIRECT_HTTPS | on |
FCGI_ROLE | RESPONDER |
PHP_SELF | /index.php/product/27.html |
REQUEST_TIME_FLOAT | 1711632782.1291 |
REQUEST_TIME | 1711632782 |