Added Order finish_date
This commit is contained in:
@@ -186,6 +186,8 @@ class OrderModel {
|
||||
GROUP BY `Order`.id
|
||||
ORDER BY `Order`.order_date ASC";
|
||||
|
||||
mfLoghandler::singleton()->debug($sql);
|
||||
|
||||
if(is_array($limit) && count($limit)) {
|
||||
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {
|
||||
$sql .= " LIMIT ".$limit['start'].", ".$limit['count'];
|
||||
@@ -212,21 +214,30 @@ class OrderModel {
|
||||
if(array_key_exists("owner_id", $filter)) {
|
||||
$ownerid= $filter['owner_id'];
|
||||
if(is_numeric($ownerid)) {
|
||||
$where .= " AND Order.owner_id=$ownerid";
|
||||
$where .= " AND `Order`.owner_id=$ownerid";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("create_by", $filter)) {
|
||||
$create_by = $filter['create_by'];
|
||||
if(is_numeric($create_by)) {
|
||||
$where .= " AND Order.create_by=$create_by";
|
||||
$where .= " AND `Order`.create_by=$create_by";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("finish_date", $filter)) {
|
||||
$finish_date = $filter['finish_date'];
|
||||
if($finish_date) {
|
||||
$where .= " AND `Order`.finish_date > 0";
|
||||
} else {
|
||||
$where .= " AND (`Order`.finish_date = 0 OR `Order`.finish_date IS NULL)";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("name", $filter)) {
|
||||
$name = FronkDB::singleton()->escape($filter['name']);
|
||||
if($name) {
|
||||
$where .= " AND Order.name='$name'";
|
||||
$where .= " AND `Order`.name='$name'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user