Fixed bug causing crash if locks in use exceeds the number of locks that are supposed to exist
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work@1043 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -55,7 +55,7 @@ class LocksController extends AppController {
|
|||||||
function gridDataFields(&$params, &$model) {
|
function gridDataFields(&$params, &$model) {
|
||||||
$fields = parent::gridDataFields($params, $model);
|
$fields = parent::gridDataFields($params, $model);
|
||||||
$fields[] = 'COUNT(LocksUnit.id) AS inuse';
|
$fields[] = 'COUNT(LocksUnit.id) AS inuse';
|
||||||
$fields[] = 'Lock.qty - COUNT(LocksUnit.id) AS avail';
|
$fields[] = 'IF(Lock.qty > COUNT(LocksUnit.id), Lock.qty - COUNT(LocksUnit.id), 0) AS avail';
|
||||||
return $fields;
|
return $fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user