Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dcarfixers
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobin
dcarfixers
Commits
c4db4a5a
Commit
c4db4a5a
authored
6 years ago
by
Jansa Jose
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'local_production'
change in single search webservice See merge request
!48
parents
9cc28fd6
7a284506
local_production
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
Webservice_model.php
application/models/Webservice_model.php
+4
-1
No files found.
application/models/Webservice_model.php
View file @
c4db4a5a
...
@@ -729,13 +729,16 @@ class Webservice_model extends CI_Model {
...
@@ -729,13 +729,16 @@ class Webservice_model extends CI_Model {
}
}
public
function
getReviewCount
(
$product_id
,
$start
,
$per_page
){
public
function
getReviewCount
(
$product_id
,
$start
,
$per_page
){
$this
->
db
->
select
(
"PRD.*,TRIM(CONCAT(CUST.first_name,' ',IFNULL(CUST.last_name,''))) as customer_name"
);
$this
->
db
->
select
(
"PRD.*,TRIM(CONCAT(CUST.first_name,' ',IFNULL(CUST.last_name,''))) as customer_name
,CUST.profile_image
"
);
$this
->
db
->
join
(
'customers CUST'
,
'CUST.customer_id = PRD.customer_id'
);
$this
->
db
->
join
(
'customers CUST'
,
'CUST.customer_id = PRD.customer_id'
);
$this
->
db
->
order_by
(
'PRD.id DESC'
);
$this
->
db
->
order_by
(
'PRD.id DESC'
);
if
(
$start
!=
0
||
$per_page
!=
0
){
if
(
$start
!=
0
||
$per_page
!=
0
){
$this
->
db
->
limit
(
$per_page
,
$start
);
$this
->
db
->
limit
(
$per_page
,
$start
);
}
}
$reviews
=
$this
->
db
->
get_where
(
'product_rating PRD'
,
array
(
'PRD.product_id'
=>
$product_id
,
'PRD.status'
=>
'1'
))
->
result
();
$reviews
=
$this
->
db
->
get_where
(
'product_rating PRD'
,
array
(
'PRD.product_id'
=>
$product_id
,
'PRD.status'
=>
'1'
))
->
result
();
foreach
(
$reviews
as
$key
=>
$value
)
{
$reviews
[
$key
]
->
rating
=
(
float
)
$value
->
rating
;
}
return
$reviews
;
return
$reviews
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment