标签:io for art cti ar log app ad
//check and add data
foreach( $excel_data_format as $fomart_k =>$fomart_v ){
//校验sub title
$sub_num = $this->submission_model->get_submission_num( array(‘sub_salesorder‘=>$fomart_k) );
if($sub_num > 0){
$msg = ‘Error: Salesorder Also In projects!‘;
$this->_render(‘submission/submission_list‘, array(‘msg‘ => $msg));
return;
}else{
//need add submission
foreach($fomart_v as $k=>$v){
//查找到catalog_id $k为catalogname
$catalog_format_arr[$catlog_id]=$v;
}
$need[$fomart_k]=$catalog_format_arr;
}
}
var_dump($sub_to_cata_need_add);
// $this->_submission_to_add($sub_to_cata_need_add);
}
}
//add submission
private function _submission_to_add($data){
$this->db->trans_begin();
foreach($data as $sub_k =>$sub_to_cata ){
$sub_add_arr = array(
‘sub_salesorder‘ =>$sub_k,
‘sub_added_by‘ =>$this->_operator_id,
‘sub_added_date‘ =>date(‘Y-m-d‘)
);
//add to submission
$sub_id = $this->submission_model->submission_add($sub_add_arr);
if (!$sub_id) {
$this->db->trans_rollback();
return FALSE;
}
//add to submission_to_operator
$operator_id_arr = $this->operator_model->get_operator_by_username($sub_to_cata[0][16]);
$sub_to_operator_arr = array(
‘operator_id‘ => $operator_id_arr[‘operator_id‘],
‘sub_id‘ => $sub_id
);
if(!$this->submission_model->submissio_to_operator_add($sub_to_operator_arr)) {
$this->db->trans_rollback();
return FALSE;
}
//add submission to _catalog
foreach ($sub_to_cata as $each_catalog_id=>$cata_application){
if( $this->submission_model->submission_add($sub_add_arr)){
}
$this->submission_model->submission_add($sub_add_arr)
}
}
}
标签:io for art cti ar log app ad
原文地址:http://www.cnblogs.com/legend-song/p/3879400.html