$count = $order->where($con) ->join("LEFT JOIN x_goods ON x_goods.goods_id = x_order.order_goodsid") ->order("order_createtime desc") ->group("order_no") ->count();// 查询满足要求的总记录数
Unable to get quantity
$count = $order->where($con) ->join("LEFT JOIN x_goods ON x_goods.goods_id = x_order.order_goodsid") ->order("order_createtime desc") ->group("order_no") ->select();// 查询满足要求的总记录数
Can get data
Reply content:
$count = $order->where($con) ->join("LEFT JOIN x_goods ON x_goods.goods_id = x_order.order_goodsid") ->order("order_createtime desc") ->group("order_no") ->count();// 查询满足要求的总记录数
Unable to get quantity
$count = $order->where($con) ->join("LEFT JOIN x_goods ON x_goods.goods_id = x_order.order_goodsid") ->order("order_createtime desc") ->group("order_no") ->select();// 查询满足要求的总记录数
Can get data
Then write it directly.
$count = count ($order->where ($con)->join ("left join x_goods on x_goods.goods_id = X_order.order_goodsid") Order ("Order_createtime desc")->group ("Order_no")->select ());//query satisfies the required total number of records
The drawback is that large data volumes can affect efficiency, resulting in too much network IO and resource consumption. Small business words do not have to worry about.
I'm guessing, ha, you try.
$count = $order->where($con) ->join("LEFT JOIN x_goods ON x_goods.goods_id = x_order.order_goodsid") ->order("order_createtime desc") ->group("order_no") ->field("count(*)") ->select();//
It is best to print out the executed SQL, the more complex logic with native SQL is best, no need to rigidly.