jobs formated

This commit is contained in:
CHIEFSOFT\ameye
2023-05-06 19:26:19 -04:00
parent d21b76aabb
commit 019e7912e8
3 changed files with 59 additions and 4 deletions
+51 -3
View File
@@ -24,6 +24,42 @@
. "AND jo.member_id = " . $_SESSION['member_id'] . " ORDER BY jo.id DESC LIMIT 400";
$query2 = $this->db->query($mysql2);
$data['offer_dash_rows'] = $query2->result();
wrenchboard=> \d members_jobs_offer
Table "public.members_jobs_offer"
Column | Type | Collation | Nullable | Default
-----------------+-----------------------------+-----------+----------+------------------------------------------------
id | integer | | not null | nextval('members_jobs_offer_id_seq'::regclass)
offer_code | character varying(15) | | not null |
member_id | integer | | |
client_id | integer | | | 0
group_id | integer | | | 0
job_id | integer | | |
email | character varying(50) | | |
job_description | text | | |
status | integer | | | 1
sent_count | integer | | | 0
loc | inet | | |
expire | timestamp without time zone | | |
added | timestamp without time zone | | | now()
payment_id | integer | | |
public_view | integer | | | 0
auto_close | timestamp without time zone | | |
reminder_count | integer | | | 0
reminder_date | timestamp without time zone | | |
uid | uuid | | |
Indexes:
"members_jobs_offer_id_key" UNIQUE CONSTRAINT, btree (id)
"members_jobs_offer_offer_code_key" UNIQUE CONSTRAINT, btree (offer_code)
Foreign-key constraints:
"members_jobs_offer_job_id_fkey" FOREIGN KEY (job_id) REFERENCES members_jobs(id)
"members_jobs_offer_member_id_fkey" FOREIGN KEY (member_id) REFERENCES members(id)
"members_jobs_offer_payment_id_fkey" FOREIGN KEY (payment_id) REFERENCES members_payments(id)
Referenced by:
TABLE "members_offer_interest" CONSTRAINT "members_offer_interest_offer_id_fkey" FOREIGN KEY (offer_id) REFERENCES members_jobs_offer(id)
TABLE "members_payments" CONSTRAINT "members_payments_what_offer_fkey" FOREIGN KEY (what_offer) REFERENCES members_jobs_offer(id)
*/
long WrenchJobManagerOffers( CVars in, CVars &out){
logfmt(logINFO, "ENTER CALL long WrenchJobManagerOffers");
@@ -41,9 +77,11 @@ long WrenchJobManagerOffers( CVars in, CVars &out){
res = pgsql_query("SELECT id FROM members_jobs_offer WHERE member_id = %lu AND status=1 AND expire > now() ", in["member_id"].Long());
out["total_record"] = pgsql_num_rows(res);
res = pgsql_query("SELECT j.id AS job_id,jo.expire, j.* FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id "
" WHERE jo.expire > now() AND jo.status = 1 AND jo.member_id = %lu AND jo.status=1 "
" ORDER BY jo.id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset);
res = pgsql_query("SELECT j.id AS job_id,jo.expire,jo.public_view, j.*,jo.uid AS offer_uid,
" (CASE WHEN jo.public_view > 0 THEN 'public' ELSE jo.email END) AS job_to "
" FROM members_jobs_offer jo LEFT JOIN members_jobs j ON j.id = jo.job_id "
" WHERE jo.expire > now() AND jo.status = 1 AND jo.member_id = %lu AND jo.status=1 "
" ORDER BY jo.id DESC LIMIT %lu OFFSET %lu", in["member_id"].Long(), limit, offset);
if (res != NULL && pgsql_num_rows(res) > 0) {
out["total_record"] = pgsql_num_rows(res);
@@ -80,6 +118,16 @@ long WrenchJobManagerOffers( CVars in, CVars &out){
snprintf(vname, sizeof (vname), "expire_%05d", i);
out[vname] = rec["expire"];
snprintf(vname, sizeof (vname), "offer_uid_%05d", i);
out[vname] = rec["offer_uid"];
snprintf(vname, sizeof (vname), "job_to_%05d", i);
out[vname] = rec["job_to"];
snprintf(vname, sizeof (vname), "public_view_%05d", i);
out[vname] = rec["public_view"];
}
}
ret = PHP_API_OK;
+3
View File
@@ -223,6 +223,9 @@ class ResultFormatter extends Model
"expire" => $out["expire_${key}"],
"sent" => $out["sent_${key}"],
"offer_code" => $out["offer_code_${key}"],
"offer_uid" => $out["offer_uid_${key}"],
"job_to" => $out["job_to_${key}"],
"public_view" => $out["public_view_${key}"],
"whishlisted"=> false,
"thumbnil" => 'marketplace-product-1.jpg',
'isActive' => true,
+5 -1
View File
@@ -150,6 +150,7 @@ function processOutJson($in, $out) {
case WRENCHBOARD_START_JOBLIST:
case WRENCHBOARD_ACCOUNT_JOBLIST:
case WRENCHBOARD_ACCOUNT_PENDJOB:
case WRENCHBOARD_JOB_OFFERS:
$total = $out["total_record"];
$res = array(
@@ -173,6 +174,9 @@ function processOutJson($in, $out) {
"expire" => $out["expire_${key}"],
"sent" => $out["sent_${key}"],
"offer_code" => $out["offer_code_${key}"],
"offer_uid" => $out["offer_uid_${key}"],
"job_to" => $out["job_to_${key}"],
"public_view" => $out["public_view_${key}"],
"whishlisted"=> false,
"thumbnil" => 'marketplace-product-1.jpg',
'isActive' => true,
@@ -188,7 +192,7 @@ function processOutJson($in, $out) {
case WRENCHBOARD_MOBILE_ACTIVEJOB:
case WRENCHBOARD_MOBILE_OFFERSLIST:
case WRENCHBOARD_JOB_LISTJOBS:
case WRENCHBOARD_JOB_OFFERS:
/* case WRENCHBOARD_JOB_OFFERS: */
$total = $out["total_record"];
$res = array(