$M_pimage = D('ProductImage');
$dataimage['pi_name'] =$thm_name[$k]?$thm_name[$k]:$_POST['p_name'];
$dataimage['p_id'] = $do;
$dataimage['pi_sort'] = (int)$thm_sort[$k];
$M_pimage->add($dataimage);
$M_pimage = D('ProductImage');
$dataimage['pi_name'] =$thm_name[$k]?$thm_name[$k]:$_POST['p_name'];
$dataimage['p_id'] = $do;
$dataimage['pi_sort'] = (int)$thm_sort[$k];
$M_pimage->add($dataimage);