php 中 mysql 操作 语句 总结

$goods = D('Goods');

// 获得总条数价格大于1000的商品

$cnt = $goods -> where ('price > 1000') -> count();   sum() 总数   max()   avg() 平均数  min()

// 转为sql语句就是 SELECT COUNT(*) AS tp_count FROM 'sw_goods' LIMIT 1

原文地址:https://www.cnblogs.com/dh2608/p/5528152.html