$orgId, 'user_id' => $userId, 'apply_id' => $id, 'dep_id' => $extra['depId'], 'create_time' => date('Y-m-d H:i:s'), 'status' => 0, 'year' => date('Y') ]; foreach ($formJson as $k=>$v){ if($v['componentName'] == 'ddabroadfield'){ foreach ($v['components'] as $key=>$val){ switch ($val['idx']){ case '0': $data['address'] = isset($val['values'])?$val['values']:''; break; case '1': $data['reason'] = isset($val['values'])?$val['values']:''; break; case '2': $values2 = isset($val['values2'])?$val['values2']:[]; $data['new'] = implode(',',$values2); break; case '3': $values2 = isset($val['values2'])?$val['values2']:[]; $data['borrow'] = implode(',',$values2); break; case '4': $values2 = isset($val['values2'])?$val['values2']:[]; if($values2){ $data['holiday_start'] = $values2[0]; $data['holiday_end'] = $values2[1]; } break; } } break; } } $ret = Db::name('abroad_apply')->insert($data); return $ret?true:false; } public function advancedEndAbroadApply($id,$orgId,$userId,$formJson){ $data = [ 'update_time' => date('Y-m-d H:i:s'), 'status' => 1 ]; // į”Ÿæˆįž–号 $maxsn = Db::name('abroad_apply')->where('year',date('Y'))->max('sn'); $maxsn = $maxsn?$maxsn+1:1; $data['sn'] = $maxsn; $data['year'] = date('Y'); $ret = Db::name('abroad_apply')->where('apply_id',$id)->update($data); return $ret?true:false; } public function advancedDisagreeAbroadApply($id){ $data = [ 'update_time' => date('Y-m-d H:i:s'), 'status' => 2 ]; $ret = Db::name('abroad_apply')->where('apply_id',$id)->update($data); return $ret?true:false; } }