mirror of
https://github.com/sctn4elk/CustomerRewardsRESTAPI.git
synced 2025-01-09 06:04:30 -06:00
Update image path
This commit is contained in:
parent
fc0237ef43
commit
9454412239
|
@ -78,6 +78,12 @@ class AttributeController extends BaseController {
|
|||
|
||||
$this->arrQueryStringParams = $this->getQueryStringParams();
|
||||
|
||||
if (isset($this->arrQueryStringParams['loyalty_attribute_name'])) {
|
||||
$this->attributeModel->attributeName = $this->arrQueryStringParams['loyalty_attribute_name'];
|
||||
$this->attributeModel->memberId = $this->arrQueryStringParams['loyalty_member_id'];
|
||||
return $this->attributeModel->findMemberAttributeByAttrName();
|
||||
}
|
||||
|
||||
if (isset($this->arrQueryStringParams['loyalty_member_id'])) {
|
||||
$response = $this->selectByMemberIdAction();
|
||||
} else {
|
||||
|
|
|
@ -14,20 +14,33 @@ class AttributeModel extends Database {
|
|||
|
||||
public function findAllAttributes()
|
||||
{
|
||||
return $this->processQuery("SELECT * FROM loyalty_attribute ORDER BY loyalty_attribute_id ASC");
|
||||
$response = $this->processQuery("SELECT * FROM loyalty_attribute ORDER BY loyalty_attribute_id ASC");
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function findAttributesByMemberId()
|
||||
{
|
||||
return $this->processQuery("SELECT * FROM loyalty_member_view WHERE loyalty_member_id = ?", ["i", $this->memberId]);
|
||||
$response = $this->processQuery("SELECT * FROM loyalty_member_view WHERE loyalty_member_id = ?", ["i", $this->memberId]);
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function findMemberAttribute()
|
||||
public function findMemberAttributeByAttrId()
|
||||
{
|
||||
$query = "SELECT * FROM loyalty_member_view WHERE loyalty_member_id = " . $this->memberId;
|
||||
$query .= " AND loyalty_attribute_id = " . $this->attributeId;
|
||||
|
||||
return $this->processQuery($query);
|
||||
$response = $this->processQuery($query);
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function findMemberAttributeByAttrName()
|
||||
{
|
||||
$query = "SELECT loyalty_attribute_id FROM loyalty_attribute WHERE loyalty_attribute_name = '" . $this->attributeName . "'";
|
||||
$data = $this->processQuery($query);
|
||||
$this->attributeId = $data[0]['loyalty_attribute_id'];
|
||||
|
||||
$response = $this->findMemberAttributeByAttrId();
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function insertAttribute($inputModel)
|
||||
|
|
Loading…
Reference in New Issue
Block a user