update flat voucher

This commit is contained in:
franknstayn
2021-12-23 22:01:02 +08:00
parent 0973ea08b2
commit 9917f8b33e
4 changed files with 66 additions and 23 deletions

View File

@@ -252,14 +252,14 @@ class TeamStoreModel extends Model
function selectFeaturedProducts($store_id = 0)
{
if($store_id == 0){
if ($store_id == 0) {
$i = DB::select("SELECT t.StoreUrl, tp.ProductName, tp.ProductPrice, tp.ProductURL, tpt.Image FROM teamstores AS t
INNER JOIN teamstore_products AS tp ON tp.TeamStoreId = t.Id
INNER JOIN teamstore_product_thumbnails as tpt ON tp.Id = tpt.ProductId
WHERE t.Password IS NULL AND t.IsHibernated IS NULL AND tpt.ImageClass = 'active' AND tp.PrivacyStatus = 'public'
ORDER BY RAND()
LIMIT 6");
} else{
} else {
$i = DB::select("SELECT t.StoreUrl, tp.ProductName, tp.ProductPrice, tp.ProductURL, tpt.Image FROM teamstores AS t
INNER JOIN teamstore_products AS tp ON tp.TeamStoreId = t.Id
INNER JOIN teamstore_product_thumbnails as tpt ON tp.Id = tpt.ProductId
@@ -267,7 +267,16 @@ class TeamStoreModel extends Model
ORDER BY RAND()
LIMIT 6");
}
return $i;
}
function checkVoucher($userid, $voucherid)
{
$i = DB::select("SELECT *
FROM payment_details AS pd
INNER JOIN orders AS o ON pd.CartKey = o.CartKey
WHERE pd.UserId = $userid AND o.VoucherId = $voucherid");
return $i;
}
}