// 构建查询
$query = $dataModel->field('mobile')
->where($structureWhere)->where($where)
->whereRaw("MATCH(mobile) AGAINST(:mobile IN BOOLEAN MODE)")
->bind(['mobile' => $matchmobile]);
// 执行查询
$res_l = $query->find();
//echo db::getlastsql();
//p($res_l);
if(empty($res_l) && ($types == 'crm_leads' || $types == 'crm_customer')){
// 构建查询
$query = $dataModels->field('mobile')
->where($structureWhere)->where($where)
->whereRaw("MATCH(mobile) AGAINST(:mobile IN BOOLEAN MODE)")
->bind(['mobile' => $matchmobile]);
// 执行查询
$res_l = $query->find();
}
全文索引
ALTER TABLE xccrm_crm_customer ADD FULLTEXT INDEX fulltext_article(mobile);