Thinkphp 获取最大值id值

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

posted @ 2018-09-19 13:24  学无边涯  阅读(4314)  评论(0编辑  收藏  举报