企业🤖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']]); } } } ~~~