首页 > 技术文章 > Thinkphp 获取最大值id值

96net 2018-09-19 13:24 原文

     有时候项目需要获取数据库最大的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

推荐阅读