有时候项目需要获取数据库最大的id值,比如生成订单,做排序号,那么Thinkphp 如何获取最大值id值。
$info=D(‘Customer‘)->where(‘1=1‘)->order(‘customer_id desc‘)->find();
???????????????//var_dump($info);
???$this->sortid =$info[‘customer_id‘];
文章来自 http://www.96net.com.cn
Thinkphp 获取最大值id值
原文地址:https://www.cnblogs.com/96net/p/9674081.html