码迷,mamicode.com
首页 > 其他好文 > 详细

dasas

时间:2014-07-30 23:39:15      阅读:459      评论:0      收藏:0      [点我收藏+]

标签: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)
}

}


}

dasas,布布扣,bubuko.com

dasas

标签:io   for   art   cti   ar   log   app   ad   

原文地址:http://www.cnblogs.com/legend-song/p/3879400.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!