ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 更新业主名 ~~~ public function meilisan(){ $list = Db::name('meilisan')->select(); foreach ($list as $key => $val) { $arr = []; $arr = explode('-', $val['room']); $building_name = $arr[0].'栋'.$arr[1].'单元'; $number = $arr[2]; $roomInfo = Db::name('room')->where( 'item_id',6 )->where('building_name',$building_name)->where('number',$number)->find(); if($val['name']!=$roomInfo['name']){ echo $val['room'].' '.$val['name'] .' -> '.$roomInfo['name']; echo '<br>'; Db::name('room')->where( 'item_id',6 )->where('building_name',$building_name)->where('number',$number)->update(['name'=>$val['name']]); } } } public function meilisi(){ $list = Db::name('meilisi')->select(); foreach ($list as $key => $val) { $arr = []; $arr = explode('-', $val['room']); $building_name = $arr[0]; $number = $arr[1]; $roomInfo = Db::name('room')->where( 'item_id',3 )->where('building_name',$building_name)->where('number',$number)->find(); if($val['name']!=$roomInfo['name']){ echo $val['room'].' '.$val['name'] .' -> '.$roomInfo['name']; echo '<br>'; Db::name('room')->where( 'item_id',3 )->where('building_name',$building_name)->where('number',$number)->update(['name'=>$val['name']]); } } } ~~~