有时响应未从代码点火器中的数据库获得



>我为代理创建了基于级别的登录,他们单击开始按钮,那些未分配给任何人的记录将分配单击开始按钮的代理。

它工作正常,但有时当代理单击开始按钮时,查询没有从表中给出任何响应,并且已经分配给代理的代码也不会显示在面板中(也没有将代码分配给代理,因为没有从表中获得响应(。

这一切都发生在 ajax 调用中

当代理注销并再次登录时,代码开始显示在他的面板上。

我在代码点火器和mysql中遇到的这个问题,请帮助我确切的问题在哪里。

这是示例代码

1(我调用了函数

public function emp_start_time(){
// x($_SESSION);
ini_set('memory_limit', '2048M'); // 2gb
ini_set('max_execution_time', 3600); //60 min
$role_id    = $this->session->userdata('role_id');
$login_id   = $this->session->userdata('login_id');
$type       = $_POST['type'];
$table_data = $this->user_data_for_emp($type);
// x($table_data);
if(!empty($table_data)){
$data['table_data'] = $table_data;
$table = $this->load->view('aof/panel/individual_def_filter_table',$data,true);
$response_data = ['status' => 'success','msg' => 'data fetched succesfully','data' => $table]; 
}else{
$response_data = ['status' => 'error','msg' => 'No data found','data' => ''];
}
echo json_encode($response_data);
}

2(从emp_start_function我们调用了另一个函数并获取查询并显示在表中

public function user_data_for_emp($type,$user_id = '',$post_data = ''){
$role_id        = $this->session->userdata('role_id');
$login_id       = $this->session->userdata('login_id');
$task_of_role   = $this->session->userdata('task_of_role');
$where_data     = '';
// y($type);x($post_data);
if($type == 'assign'){
$esign_today_date = date('Y-m-d');
$where_data .= '(video = 1 or uad.ipv = 1) and sign != 0 and mf_only = 0 and  date(ed.esign_date) >= "2018-12-01" and date(ed.esign_date) <= "'.$esign_today_date.'" and '; 
if($task_of_role == '1,2' || $task_of_role == '2' || $task_of_role == '8'){
$where_data .= "login_id = 0 and client_id != '' and ucc_done = 0 and client_interested = 0";
$order_by = "esign_date ASC";
}else{
$where_data .= "login_id = 0 and client_id = '' and ucc_done = 0 and client_interested = 0";
$order_by = "esign_date ASC";
}
}else if($type == 'load'){
// $where_data .= 'login_id ="'.$login_id.'" and client_interested = 0';
$where_data .= 'login_id ="'.$login_id.'" and ucc_done = 0 and client_interested = 0 and uad.mf_only = 0';
$order_by = "esign_date ASC";
}else if($type == 'task_comp'){
$where_data .= 'ua.id ="'.$user_id.'"';
$order_by = "esign_date ASC";
}else if($type == 'def_filter'){
// $where_data .= 'login_id ="'.$login_id.'" and date(uad.def_mail_sent_date) >= "'.$post_data['from_date'].'" and date(uad.def_mail_sent_date) <= "'.$post_data['to_date'].'"';
$where_data .= 'login_id ="'.$login_id.'" and date(uad.def_mail_sent_date) >= "'.$post_data['from_date'].'" and date(uad.def_mail_sent_date) <= "'.$post_data['to_date'].'" and uad.mf_only = 0';
if(!empty($post_data['states'])){
if($post_data['states'] == 1){ //south
$where_data .= ' AND ua.p_state IN ("'.implode('","', SOUTH_LEAD_STATES).'")';
}else{ //Non south
$where_data .= ' AND ua.p_state NOT IN ("'.implode('","', SOUTH_LEAD_STATES).'")';
}
}
$order_by = "uad.def_mail_sent_date DESC";
}
if($type == 'assign'){
$select_data = 'ua.id, ua.client_id, ua.ekyc, ua.acc_ownership, ua.form_received, ed.id as def_id, ed.pan as doc_pan, ed.cancelled_cheque, ed.signature, ed.income_proof, ed.photograph, ed.address_proof, ed.poa, ed.video_segments, ed.e_sign_pan, ed.poa_document_received, uad.sign_time, ed.esign_date, uad.sign,             uad.techexcel_export, uad.kyc_mode, uad.ucc_done, uad.login_id, uad.role_status, uad.ipv, uad.def_mail_sent_date, uad.uploaded_date,
';
}else{
$select_data = 'ua.id, ua.client_id, ua.ekyc, ua.name, ua.email, ua.acc_ownership, ua.mobile, ua.ms_name, ua.pan, ua.segment, ua.p_state, ua.kra_status, ua.kra_status_code, ua.kra_fetch_time, ua.date_created, ua.kra_email, ua.form_received, ua.bank_verfiy, ua.mf_registered, ed.id as def_id, ed.pan as doc_pan, ed.cancelled_cheque, ed.signature, ed.income_proof, ed.photograph, ed.address_proof, ed.poa, ed.video_segments, ed.e_sign_pan, ed.poa_document_received, ed.nach_document_received, uad.name_as_per_pan, uad.video_time, uad.sign_time, ed.esign_date, uad.sign, ua.kra_document_fetch,
uad.techexcel_export, uad.kyc_mode, uad.ucc_done, uad.login_id, uad.role_status, uad.ipv, uad.def_mail_sent_date, uad.uploaded_date,
'; 
}
$params                     = [];
$params['env']              = 'sm_db';
$params['table_name']       = 'sm_user_account ua';
$params['select_data']      = $select_data;
$params['where']            = TRUE;
$params['where_data']       = $where_data;
$params['where_escape']     = false;
$params['join']             = TRUE;
$params['multiple_joins']   = TRUE;
$params['join_table']       = array('sm_ekyc_deficiency ed','sm_user_account_details uad');
$params['join_on']          = array('ua.id = ed.user_id','ua.id = uad.user_id');
$params['order_by']         = $order_by;
$params['join_type']        = array('LEFT','LEFT');
// $params['print_query_exit'] = true;
$table_data = $this->comm->get_table_data_with_type($params);
// x($table_data);
$remark_list = $this->getStandardRemarkList();
// x($remark_list);
if($type != 'assign'){
$i = 0;
foreach($table_data as $k => $v){
$params                 = array();
$params['env']          = 'sm_db';
$params['select_data']  = 'id';
$params['table_name']   = 'sm_ekyc_uploads';
$params['where']        = true;
// $params['print_query_exit']        = true;
$params['where_escape'] = false;
$params['where_data']   = array('user_id' => $v->id,'type' => 'cancelled_cheque');
$params['order_by']         ="id DESC";
$params1['limit_data']       = "1";            
$res = $this->comm->get_table_data_with_type($params)[0]->id;
$table_data[$i]->c_cheque = $res;
$params                 = array();
$params['env']          = 'star_db';
$params['select_data']  = 'login_name';
$params['table_name']   = 'sm_login_master';
$params['where']        = true;
// $params['print_query_exit']        = true;
$params['where_escape'] = false;
$params['where_data']   = array('login_id' => $v->login_id);
$login_data = $this->comm->get_table_data_with_type($params)[0]->login_name;
if(!empty($login_data)){
$table_data[$i]->login_name = $login_data;
}else{
$table_data[$i]->login_name = ''; 
}
$params                     = [];
$params['env']              = 'sm_db';
$params['table_name']       = 'sm_user_mgt_history umg';
$params['select_data']      = 'umg.login_id,lm.login_name,rc.name_of_role';
$params['where']            = TRUE;
$params['where_data']       = array('umg.user_id' => $v->id);
$params['join']             = TRUE;
$params['multiple_joins']   =TRUE;
// $params['join_table']       = STAR_DB.'.sm_login_master lm';
$params['join_table']       = array(STAR_DB.'.sm_login_master lm',STAR_DB.'.sm_role_creation rc');
$params['join_on']          = array('umg.login_id = lm.login_id','umg.role_id = rc.role_id');
// $params['join_on']          = 'umg.login_id = lm.login_id';
$params['order_by']         = "umg.id ASC";
// $params['join_type']        = 'LEFT';
$params['join_type']        = array('LEFT','LEFT');
$params['return_array']     = true;
// $params['print_query_exit'] = true;
$login_his_data = $this->comm->get_table_data_with_type($params);
// x($login_his_data);
if(!empty($login_his_data)){
$user_data = $login_his_data;
}else{
$user_data = [];
}
$table_data[$i]->user_data = $user_data;
// Remarks of users
$params                 = array();
$params['env']          = 'sm_db';
$params['select_data']  = 'id,remark,standard_remark_flg,executive_id';
$params['table_name']   = 'sm_remarks';
$params['where']        = true;
// $params['print_query']  = true;
$params['where_data']   = array('user_id' => $v->id);
$params['order_by']     ="id DESC";
$remarks = $this->comm->get_table_data_with_type($params)[0];
if($remarks->standard_remark_flg != 5){
$table_data[$i]->latest_remarks = $remark_list[$remarks->standard_remark_flg]['remark'];
}
else{
$table_data[$i]->latest_remarks = $remarks->remark;
}
$umg_param                     = [];
$umg_param['env']              = 'sm_db';
$umg_param['table_name']       = 'sm_user_mgt_history umg';
$umg_param['select_data']      = 'umg.id as umg_id';
$umg_param['where']            = TRUE;
$umg_param['where_data']       = array('umg.user_id' => $v->id,'umg.login_id' => $login_id,'status'=>0);
$table_data[$i]->umg_id = $this->comm->get_table_data_with_type($umg_param)[0]->umg_id;
$table_data[$i]->executive = $remarks->executive_id;
$i++;
}
}
// x($table_data);
return $table_data; 
}

3(但有时我找不到写在其他地方的msg的数据

提前谢谢你

问题出在我的 MYSQL 查询时间中,我增加了查询响应时间,现在它正在工作。

感谢您的支持和帮助

相关内容

  • 没有找到相关文章

最新更新