task messsage

This commit is contained in:
CHIEFSOFT\ameye
2023-07-15 06:36:48 -04:00
parent 5df8ada174
commit fe1393d62c
2 changed files with 9 additions and 1 deletions
+8 -1
View File
@@ -321,7 +321,7 @@ long WrenchContractMessageList( CVars in, CVars &out )
res = pgsql_query(" SELECT to_char(jc.created, 'YYYY-MM-DD HH24:MI') AS msg_date,"
" m.firstname AS msg_firstname,jc.id as msg_id,jc.message AS msg,"
" jc.msg_type, jc.message "
" jc.msg_type, jc.message,jc.member_id AS sender_id "
" FROM jobs_contract_message jc "
" LEFT JOIN members m ON m.id=jc.member_id "
" WHERE jc.contract='%s' ORDER by jc.id DESC", in["contract"].c_str());
@@ -353,6 +353,13 @@ long WrenchContractMessageList( CVars in, CVars &out )
snprintf(vname, sizeof (vname), "message_%05d", i);
out[vname] = rec["message"];
snprintf(vname, sizeof (vname), "who_%05d", i);
if( sender_id == member_id){
out[vname] = "SENDER";
}
else{
out[vname] = "RECIPIENT";
}
}
}
+1
View File
@@ -299,6 +299,7 @@ class ResultFormatter extends Model
"msg_firstname" => $out["msg_firstname_${key}"],
"msg_id" => $out["msg_id_${key}"],
"msg_type" => $out["msg_type_${key}"],
"who" => $out["who_${key}"],
);
}
break;