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

@@ -41,7 +41,7 @@ class DesignerModel extends Model {
function selectDefaultTemplateColor($templateCode){
$pdo = DB::connection()->getPdo();
$query = $pdo->prepare("SELECT NULL AS RGBIndex, RGBColor AS default_Color FROM template_body_colors WHERE TemplateCode = '$templateCode' UNION SELECT TrimNumber, RGBColor AS default_Color FROM template_trim_colors WHERE TemplateCode = '$templateCode'");
$query = $pdo->prepare("SELECT NULL AS RGBIndex, RGBColor AS default_Color, DisplayName FROM template_body_colors WHERE TemplateCode = '$templateCode' UNION SELECT TrimNumber, RGBColor AS default_Color, DisplayName FROM template_trim_colors WHERE TemplateCode = '$templateCode'");
$query->execute();//$query->execute(array($bindings ));
// $row=$query->fetch(\PDO::FETCH_OBJ);
@@ -51,9 +51,11 @@ class DesignerModel extends Model {
}else{
$IndexName = $row->RGBIndex;
}
$arr_default_mainColor[] = array($IndexName => $row->default_Color);
$arr_default_mainColor[] = array(
$IndexName => $row->default_Color,
'h4_Trim_' . $IndexName => $row->DisplayName,
);
}
// var_dump($arr_default_mainColor);
return $arr_default_mainColor;
}

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;
}
}