fixed user dashboard for store owner (store settings, store reports)/ fixed login/register page/

This commit is contained in:
Frank John Begornia
2019-09-24 19:52:38 +08:00
parent 502b13e793
commit 83f0624f07
45 changed files with 17655 additions and 373 deletions

View File

@@ -153,6 +153,22 @@ class UserModel extends Model {
return $i;
}
function selectOrder($field, $value){
$i = DB::table('orders')
->where($field, $value)
->get();
return $i;
}
function selectStoreOrders($store_id){
$i = DB::table('orders')->select('orders.*', 'payment_details.InvoiceNumber', 'payment_details.Currency')
->leftjoin('payment_details', 'payment_details.CartKey','=','orders.CartKey')
->where('orders.StoreId', $store_id)
->orderby('orders.DateCreated', 'DESC')
->get();
return $i;
}
function itemGroup($cartKey){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT *, COUNT(Id) AS qty, Price * SUM(Quantity) AS total_price FROM orders WHERE CartKey = :ck GROUP BY ProductId");
@@ -181,6 +197,22 @@ class UserModel extends Model {
return $i;
}
function selectDisplayItemThumbById($id){
$i = DB::table('teamstore_product_thumbnails')
->where('ProductId', $id)
->where('ImageClass', 'active')
->get();
return $i;
}
function deleteImageThumb($field, $id){
$i = DB::table('teamstore_product_thumbnails')
->where($field, $id)
->delete();
return $i;
}
function selectItemsStoreId($ck){
$i = DB::table('cart_tmp')
@@ -238,4 +270,20 @@ class UserModel extends Model {
$i = DB::table('teamstore_product_thumbnails')->where('Id', $id)
->update(['Ordering' => $order]);
}
function updateTeamstore($id, $data){
$i = DB::table('teamstores')
->where("Id", $id)
->update($data);
return $i;
}
function selectShippingAddress($field, $value){
$i = DB::table('shipping_addresses')
->where($field, $value)
->get();
return $i;
}
}