thinkphp更新某几个字段的值
2022-07-28 14:14:58
147
{{single.collect_count}}

thinkphp更新只某几个字段的值,在官网看到案例think PHP完全开发手册地址
在这里插入图片描述
结合案例一次更新某几个字段

 public function retreatupdate(){$token = $this->is_login();if($token>0){$data = input("request.data/a");$id = $data['id'];//执行语句$arr = Db::name('Base_station_record')->where("id={$id}")->setField(["y_processing_person"=>$data['y_processing_person'],"y_phone"=>$data['y_phone'],"y_cause_classification"=>$data['y_cause_classification'],"y_cause_of_issue"=>$data['y_cause_of_issue'],"y_verify_inspection"=>$data['y_verify_inspection'],"y_record"=>$data['y_record'],"t_processing_person"=>$data['t_processing_person'],"t_phone"=>$data['t_phone'],"t_cause_classification"=>$data['t_cause_classification'],"t_cause_of_issue"=>$data['t_cause_of_issue'],"t_verify_inspection"=>$data['t_verify_inspection'],"t_record"=>$data['t_record'],]);if($arr){ajaxmsg('修改成功',1);}else{ajaxmsg('修改失敗',0);}}}
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}