目录
日志
方法: \think\facade\Log::write('sth');
日志路径: /src/runtime/admin/log
路由
路径: /src/route/admin/app.php
域名绑定/对应不同App
// 域名绑定(自动多应用模式有效)
'domain_bind' => [
'api.xxx.com/'=>'admin',
'pay.xxx.com'=>'payment',
'protal.xxx.com'=>'protal',
],
控制台命令
/src/config/console.php
复杂sql查询
[sql] SELECT * FROM `order_logs` WHERE ( orderid=7614 AND addtime between '2020-05-10 05:50:02' AND '2020-05-11 05:50:02' AND (message like '%取消%' or message like '%断货%') )
#写法:
$sql = "orderid=:orderid AND addtime between :start AND :end AND "
. "(message like :m1 or message like :m2 or message like :m3 or message like :m4)";
$logs = OrderLog::whereRaw($sql, [
'orderid' => $item->order->id,
'start' => $item->order->adddate,
'end' => $date1->format('Y-m-d H:i:s'),
'm1' => '%取消%',
'm2' => '%断货%',
'm3' => '%退款%',
'm4' => '%争议%',
])->select();