crewsportswear update as of 3_18_19

This commit is contained in:
Frank John Begornia
2019-03-18 13:48:37 +08:00
parent 562f03488a
commit a2d88bc52e
71 changed files with 5443 additions and 85 deletions

View File

@@ -65,9 +65,9 @@ class UserModel extends Model {
return $i;
}
function selectPaymentDetails($userid){
function selectPaymentDetails($field, $val){
$i = DB::table('payment_details')->where('UserId', $userid)
$i = DB::table('payment_details')->where($field, $val)
->get();
return $i;
@@ -134,4 +134,28 @@ class UserModel extends Model {
return $i;
}
function selectOrderItem($ck){
$i = DB::table('orders')
->where('CartKey', $ck)
->get();
return $i;
}
function itemGroup($cartKey){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT *, COUNT(Id) AS qty, SUM(Price) AS total_price, SUM(Quantity) AS total_qty FROM orders WHERE CartKey = :ck GROUP BY ProductId");
$query->execute([':ck'=>$cartKey]);
$row = $query->fetchAll(\PDO::FETCH_OBJ);
return $row;
}
function selectDisplayItemThumb(){
$i = DB::table('teamstore_product_thumbnails')
->where('ImageClass', 'active')
->get();
return $i;
}
}