From 26d2b97e21f47c4daebadea849c43edc44a0f792 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GBA0BK8\\Admin" Date: Sun, 19 Mar 2023 00:29:18 -0400 Subject: [PATCH] job format --- www-api/public/svs/user/formarter.php | 44 +++++++++++++++++++-------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/www-api/public/svs/user/formarter.php b/www-api/public/svs/user/formarter.php index 2d60415e..761f7dcb 100755 --- a/www-api/public/svs/user/formarter.php +++ b/www-api/public/svs/user/formarter.php @@ -175,6 +175,7 @@ function processOutJson($in, $out) { 'job_country' => $out["job_country_${key}"], 'currency' => 'Naira', 'currency_code' => 'NGN', + 'category' => dummyGetCategory() ); } @@ -192,19 +193,17 @@ function processOutJson($in, $out) { for ($i = 0; $i < $total; $i++) { $key = sprintf("%05d", $i); $res["result_list"][] = array( - "title" => $out["title_${key}"], - "description" => $out["description_${key}"], - "id" => $out["id_${key}"], - "job_description" => $out["job_description_${key}"], - "price" => $out["price_${key}"], - "timeline_days" => $out["timeline_days_${key}"], - - "contract_id" => $out["contract_id_${key}"], - "job_id" => $out["job_id_${key}"], - "contract" => $out["contract_${key}"], - "status_description" => $out["status_description_${key}"], - - "delivery_date" => $out["delivery_date_${key}"] + "title" => $out["title_${key}"], + "description" => $out["description_${key}"], + "id" => $out["id_${key}"], + "job_description" => $out["job_description_${key}"], + "price" => $out["price_${key}"], + "timeline_days" => $out["timeline_days_${key}"], + "contract_id" => $out["contract_id_${key}"], + "job_id" => $out["job_id_${key}"], + "contract" => $out["contract_${key}"], + "status_description" => $out["status_description_${key}"], + "delivery_date" => $out["delivery_date_${key}"] ); } @@ -303,6 +302,25 @@ function processOutJson($in, $out) { return $res; } +function dummyGetCategory(){ +$i= rand(1,4); +$res=array(); + switch ($i) { + case 1: + $res= array('CT1', 'CT2'); + break; + case 2: + $res= array( 'CT3', 'CT4'); + break; + case 3: + $res= array('CT1', 'CT4',); + break; + case 4: + $res= array( 'CT4'); + break; + } + return $res; +} function dummyCategory(){ return array(