时间:2021-07-01 10:21:17 帮助过:13人阅读
方式二:
1 $query = new \yii\db\Query(); 2 $query->select(‘pa_call.id,pa_call.tableid,pa_call.time as msgtime,pa_table_area.id as areaid,pa_table_area.areaname as area,pa_table.tablename,pa_call.message as msg,pa_call.new as needoper,pa_call.status as isdone,pa_employee.username as oper‘) 3 ->from(Call::tableName()) 4 ->join(‘LEFT JOIN‘,Table::tableName(),‘pa_call.tableid=pa_table.id‘) 5 ->join(‘LEFT JOIN‘,Area::tableName(),‘pa_table_area.id=pa_table.areaid‘) 6 ->join(‘LEFT JOIN‘,Employee::tableName(),‘pa_call.employeeid=pa_employee.id‘) 7 ->where($where); 8 $command = $query->createCommand(); 9 $data = $command->queryAll();
yii2之原生sql
标签:nec use com time select employee pre connect logs