select count(*) from laporan where date(w_laporan) = date(timestamps)
如何在Laravel 5查询构建器中使用此查询? 感谢。
答案 0 :(得分:0)
您可以尝试这样的事情:
$someDate = '2015-06-09';
$result = \DB::select(
\DB::raw("SELECT count(*) as total FROM items WHERE DATE(w_laporan) = :someDate"),
['someDate' => $someDate]
);
答案 1 :(得分:0)
请尝试以下操作。
using System.Globalization;
...
decimal myValue = -0.123m;
NumberFormatInfo percentageFormat = new NumberFormatInfo { PercentPositivePattern = 1, PercentNegativePattern = 1 };
string formattedValue = myValue.ToString("P2", percentageFormat); // "-12.30%" (in en-us)