major update
This commit is contained in:
@@ -1,14 +1,8 @@
|
||||
from flask import request, jsonify
|
||||
from flask_login import current_user
|
||||
from sqlalchemy.sql import func
|
||||
from datetime import date, timedelta
|
||||
|
||||
from app.search import search
|
||||
from app import db
|
||||
from datetime import datetime
|
||||
|
||||
from app.classes.auth import Auth_User
|
||||
from app.classes.customer import Customer_Customer, Customer_Customer_schema
|
||||
from app.classes.employee import Employee_Employee
|
||||
from app.classes.delivery import Delivery_Delivery, Delivery_Delivery_schema
|
||||
|
||||
|
||||
@@ -24,6 +18,7 @@ def search_customers():
|
||||
search = search.replace("!", "")
|
||||
search = search.replace("#", "")
|
||||
search = search.replace("@", "")
|
||||
search = search.replace("$", "")
|
||||
# search by last name
|
||||
if search_type == '@':
|
||||
search = search[1:]
|
||||
@@ -31,7 +26,7 @@ def search_customers():
|
||||
.query(Customer_Customer)
|
||||
.filter(Customer_Customer.customer_last_name.ilike(search))
|
||||
.all())
|
||||
|
||||
# Customer Address
|
||||
elif search_type == '!':
|
||||
|
||||
search = search[::1]
|
||||
@@ -46,6 +41,15 @@ def search_customers():
|
||||
.query(Customer_Customer)
|
||||
.filter(Customer_Customer.customer_phone_number.ilike(search))
|
||||
.all())
|
||||
# Account Number
|
||||
elif search_type == '$':
|
||||
search = search[::1]
|
||||
|
||||
customer_list = (db.session
|
||||
.query(Customer_Customer)
|
||||
.filter(Customer_Customer.account_number.ilike(search))
|
||||
.order_by(Customer_Customer.account_number.asc())
|
||||
.all())
|
||||
|
||||
else:
|
||||
customer_list = (db.session
|
||||
|
||||
Reference in New Issue
Block a user