fixed workorder company view for status filter
This commit is contained in:
@@ -115,7 +115,9 @@ class WorkorderModel extends TTCrudBaseModel
|
||||
private static function buildCompanyWhereClause(array $filters, int $companyId): string
|
||||
{
|
||||
$sql = "(w.companyId = " . $companyId . " OR w.civilEngineeringCompanyId = " . $companyId . ")";
|
||||
$sql .= " AND w.status NOT IN ('completed', 'cancelled')";
|
||||
|
||||
if (empty($filters['status'])) $sql .= " AND w.status NOT IN ('completed', 'cancelled')";
|
||||
else $sql .= Helper::generateFilterCondition($filters['status'], 'w.status', true);
|
||||
if (!empty($filters['id'])) $sql .= Helper::generateFilterCondition($filters['id'], 'w.id', true);
|
||||
if (!empty($filters['status'])) $sql .= Helper::generateFilterCondition($filters['status'], 'w.status');
|
||||
if (!empty($filters['deadlineDate'])) $sql .= Helper::generateFilterCondition($filters['deadlineDate'], 'w.deadlineDate');
|
||||
|
||||
@@ -30,11 +30,6 @@ class WorkorderCompanyController extends WorkorderBaseController {
|
||||
$this->additionalJSVariables['COMPANY_ID'] = $company ? $company->id : 0;
|
||||
}
|
||||
|
||||
//region ACTIONS
|
||||
public function indexAction() {
|
||||
parent::indexAction();
|
||||
}
|
||||
|
||||
protected function logout() {
|
||||
mfLoginController::staticLogout();
|
||||
$this->redirect('/WorkorderCompany/Mobile');
|
||||
@@ -43,15 +38,11 @@ class WorkorderCompanyController extends WorkorderBaseController {
|
||||
public function mobileAction() {
|
||||
$company = WorkorderCompanyModel::getFirst(['addressId' => $this->user->address_id]);
|
||||
|
||||
$vue_config = [
|
||||
$this->layout()->setTemplate("VueViews/WorkorderCompanyPWA");
|
||||
$this->layout()->set("JSGlobals", [
|
||||
'BASE_PATH' => '/WorkorderCompany',
|
||||
'COMPANY_ID' => $company ? $company->id : 0,
|
||||
// You can add more global variables for your Vue app here
|
||||
];
|
||||
|
||||
// This tells the framework to use your new PWA layout file
|
||||
$this->layout()->setTemplate("VueViews/WorkorderCompanyPWA");
|
||||
$this->layout()->set("JSGlobals", $vue_config);
|
||||
]);
|
||||
}
|
||||
|
||||
protected function getAction() {
|
||||
|
||||
Reference in New Issue
Block a user