项目中一段保存配置weixin appid代码,都来吐几句吧 /** * 判断是否有$company_id公司的微信配置,并加锁,防止其他进程更新新增 */ public function exists_weixin_config_and_add_row_lock($company_id){ return $this->db->query( 'select exists( select * from weixin_config where company_id = ? for update ) as has', array($company_id))->row()->has == 1; }
