diff --git a/ajax/ajax_vue_requisitions.php b/ajax/ajax_vue_requisitions.php index 026510a..d34d51a 100644 --- a/ajax/ajax_vue_requisitions.php +++ b/ajax/ajax_vue_requisitions.php @@ -2382,4 +2382,17 @@ if($request == 'get_deals_by_objects'){ exit(); } +if($request == 'get_deal_data'){ + $deal_id = intval($data->deal_id); + $sql = "SELECT id, title, side_one, side_two, side_one_requisition_id, side_two_requisition_id, side_one_object_id, side_two_object_id, contract_price, object_price, commission_buyer, commission_seller, agent_commission, total_commission, sellers_count, buyers_count, proxy_sale, e_registration, mortgaged, mortgagee, debt_amount, has_counter_agent, counter_agent_name, counter_agent_commission, counter_agent_phone, deal_date, status FROM deals WHERE id = $deal_id AND status != 2 LIMIT 1"; + $q = $pdo->query($sql); + $deal = null; + if($q && $pdo->num_rows($q) > 0){ + $deal = $pdo->fetch_assoc($q); + $deal['id'] = (int)$deal['id']; + } + echo json_encode(['deal' => $deal]); + exit(); +} + ?> diff --git a/js/deals_client_vue.js b/js/deals_client_vue.js index f825067..ef19024 100644 --- a/js/deals_client_vue.js +++ b/js/deals_client_vue.js @@ -24,7 +24,10 @@ var deals_client = new Vue({ var res = response.data; if (res.deals && res.deals.length > 0) { var promises = res.deals.map(dealId => { - return axios.get('/api/deals/' + dealId).then(r => r.data.data).catch(() => null); + return axios.post('/ajax/ajax_vue_requisitions.php', { + request: 'get_deal_data', + deal_id: dealId, + }).then(r => r.data.deal || null).catch(() => null); }); Promise.all(promises).then(results => { deals_client.dealsList = results.filter(d => d !== null); diff --git a/templates/footer.php b/templates/footer.php index 7cb02b1..bbd3ff4 100644 --- a/templates/footer.php +++ b/templates/footer.php @@ -3229,8 +3229,13 @@ $user_id = $_SESSION['id'];
-
+
+
+ + + +
{{ item.title }}
{{ item.side_one }} / {{ item.side_two }} @@ -3241,11 +3246,6 @@ $user_id = $_SESSION['id']; -
- - - -