增加一段代码 : int main() { string sql; db_select_area(1); sql = "select o_manager_dept_id,o_manager_emp_id,o_place,n_manager_dept_id,n_manager_emp_id,n_place,move_type,agree_emp_id,note_info,move_date "; sql = sql + "from asset_move where asset_id = '" + asset_id + "' order by asset_id desc " ; db_run(sql); if(db_row_count()>0) { o_manager_dept_id = dt_get_name("asset_dept",db_res(0)); o_manager_emp_id = dt_get_name("asset_emp",db_res(1)); o_place = db_res(2); n_manager_dept_id = dt_get_name("asset_dept",db_res(3)); n_manager_emp_id = dt_get_name("asset_emp",db_res(4)); n_place = db_res(5); move_type = dt_get_name("asset_move_type",db_res(6)); agree_emp_id = dt_get_name("asset_emp",db_res(7)); note_info = db_res(8); move_date = fmt_date(db_res(9),"yyyy-mm-dd"); } else { msg("该资产卡片没有资产转移记录!"); o_manager_dept_id = ""; o_manager_emp_id = ""; o_place = ""; n_manager_dept_id=""; n_manager_emp_id = ""; n_place=""; move_type=""; agree_emp_id=""; note_info=""; move_date = ""; } db_select_area(0); return 1; }; |