Commit e75693f1 by Jansa Jose

payment

parent f7cfb1e2
......@@ -2606,21 +2606,22 @@
public function bulkOrderBooking(){
header('Content-type:application/json');
$headers = apache_request_headers();
if(!isset($headers['Auth']) || empty($headers['Auth'])){
$post = file_get_contents("php://input");
if(empty($post) || empty($postData = json_decode($post,true)) ||
!isset($postData['Auth']) || empty($postData['Auth']) ||
!isset($postData['data']) || empty($postData['data'])){
$this->fail();
}
$authRes = $this->Webservice_model->get_customer_authtoken($headers['Auth']);
$authRes = $this->Webservice_model->get_customer_authtoken($postData['Auth']);
if($authRes['status'] == 'error'){
$this->fail();
}
$post = file_get_contents("php://input");
$postData = json_decode($post, true);
$postData['customer_id'] = $authRes['data']['customer_id'];
$result = $this->Webservice_model->bulkOrderBooking($postData);
if($result['status'] == 'success'){
$this->orderPayNowApi($result['data']);
}
......
......@@ -1122,7 +1122,7 @@ class Webservice_model extends CI_Model {
}
$result = $this->db->query("SELECT ROUND(AVG(REV.rating),2) AS rating,
COUNT(REV.id) AS reviews,PRD.product_name,PRD.short_description,PRD.part_id,TRANS.id AS transId,
TRANS.status AS tranStatus,TRANS.datetime,ORD.*,PI.image as product_image
TRANS.status AS tranStatus,TRANS.datetime,ORD.*,PI.image as product_image,BRND.brand_name
FROM orders ORD
JOIN products PRD ON ORD.product_id = PRD.product_id
JOIN transaction TRANS ON (ORD.order_id = TRANS.booking_id AND TRANS.payment_for= '2')
......@@ -1133,6 +1133,8 @@ class Webservice_model extends CI_Model {
FROM product_images
WHERE product_id= PRD.product_id AND
PRD.status='1'))
JOIN product_brand AS BRND ON BRND.brand_id = PRD.brand_id
WHERE ORD.customer_id=".$postData['customer_id']." GROUP BY ORD.order_id ORDER BY ORD.order_id DESC $lmt");
if(empty($result) || empty($result = $result->result())){
$respArr['status'] = "error";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment