mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 12:24:01 +00:00
contract template obligation contract template dependency UI
This commit is contained in:
@@ -178,9 +178,6 @@ class ContractModule extends BaseController
|
||||
$contract->complete_day_range = $complete_day_range ?? $contract->complete_day_range;
|
||||
$contract->update();
|
||||
|
||||
|
||||
|
||||
|
||||
// log
|
||||
ContractModule::makeLog($contract->id, 'user (' . Auth::guard('user-api')->user()->id . ') updated');
|
||||
|
||||
|
||||
+13
-5
@@ -11,7 +11,7 @@ use App\Http\Modules\User\ContractTemplateObligationModule;
|
||||
|
||||
use App\Http\Rules\User\UnderCheck;
|
||||
use App\Http\Rules\User\ExistCheck;
|
||||
use App\Http\Rules\User\ContractTemplateObligationDependencyCheck;
|
||||
use App\Http\Rules\User\ContractTemplateObligationContractTemplateDependencyCheck;
|
||||
|
||||
use App\Http\Helpers\General;
|
||||
use App\Http\Helpers\Hasher;
|
||||
@@ -33,7 +33,9 @@ class ContractTemplateObligationContractTemplateDependencyModule extends BaseCon
|
||||
public static function list(Request $request)
|
||||
{
|
||||
General::storeCachePerviousQuery($request->query(), 'contract_template_obligation_contract_template_dependency_query');
|
||||
|
||||
|
||||
$contract_template_obligation_hash_id = $contract_template_obligation_id = $request->get('contract_template_obligation_id', []);
|
||||
|
||||
$name = $request->get('name', null);
|
||||
$status = $request->get('status', []);
|
||||
$page = $request->get('page', null);
|
||||
@@ -41,7 +43,12 @@ class ContractTemplateObligationContractTemplateDependencyModule extends BaseCon
|
||||
|
||||
$query = ContractTemplateObligationContractTemplateDependency::query();
|
||||
|
||||
if (strlen($name) > 0) {
|
||||
if (!empty($contract_template_obligation_id)) {
|
||||
$contract_template_obligation_id = Hasher::decodeArray('contract_template_obligations', $contract_template_obligation_id);
|
||||
$query->whereIn('contract_template_obligation_id', $contract_template_obligation_id);
|
||||
}
|
||||
|
||||
if (strlen($name) > 0) {
|
||||
$query->where('name', 'like', '%' . $name . '%');
|
||||
}
|
||||
|
||||
@@ -54,6 +61,7 @@ class ContractTemplateObligationContractTemplateDependencyModule extends BaseCon
|
||||
$query->orderBy('id', 'desc');
|
||||
|
||||
$params = [
|
||||
'contract_template_obligation_id' => $contract_template_obligation_hash_id,
|
||||
'name' => $name,
|
||||
'status' => $status,
|
||||
'page' => $page
|
||||
@@ -155,12 +163,12 @@ class ContractTemplateObligationContractTemplateDependencyModule extends BaseCon
|
||||
'required',
|
||||
new UnderCheck('contract_template_obligation'),
|
||||
new ExistCheck('contract_template_obligation'),
|
||||
// new ContractTemplateObligationDependencyCheck($data['depend_contract_template_obligation_id'] ?? [])
|
||||
],
|
||||
'depend_contract_template_id' => [
|
||||
'required',
|
||||
new UnderCheck('contract_template'),
|
||||
new ExistCheck('contract_template')
|
||||
new ExistCheck('contract_template'),
|
||||
// new ContractTemplateObligationContractTemplateDependencyCheck($data['contract_template_obligation_id'] ?? [])
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -32,7 +32,9 @@ class ContractTemplateObligationDependencyModule extends BaseController
|
||||
public static function list(Request $request)
|
||||
{
|
||||
General::storeCachePerviousQuery($request->query(), 'contract_template_obligation_dependency_query');
|
||||
|
||||
|
||||
$contract_template_obligation_hash_id = $contract_template_obligation_id = $request->get('contract_template_obligation_id', []);
|
||||
|
||||
$name = $request->get('name', null);
|
||||
$status = $request->get('status', []);
|
||||
$page = $request->get('page', null);
|
||||
@@ -40,7 +42,12 @@ class ContractTemplateObligationDependencyModule extends BaseController
|
||||
|
||||
$query = ContractTemplateObligationDependency::query();
|
||||
|
||||
if (strlen($name) > 0) {
|
||||
if (!empty($contract_template_obligation_id)) {
|
||||
$contract_template_obligation_id = Hasher::decodeArray('contract_template_obligations', $contract_template_obligation_id);
|
||||
$query->whereIn('contract_template_obligation_id', $contract_template_obligation_id);
|
||||
}
|
||||
|
||||
if (strlen($name) > 0) {
|
||||
$query->where('name', 'like', '%' . $name . '%');
|
||||
}
|
||||
|
||||
@@ -53,6 +60,7 @@ class ContractTemplateObligationDependencyModule extends BaseController
|
||||
$query->orderBy('id', 'desc');
|
||||
|
||||
$params = [
|
||||
'contract_template_obligation_id' => $contract_template_obligation_hash_id,
|
||||
'name' => $name,
|
||||
'status' => $status,
|
||||
'page' => $page
|
||||
@@ -154,12 +162,12 @@ class ContractTemplateObligationDependencyModule extends BaseController
|
||||
'required',
|
||||
new UnderCheck('contract_template_obligation'),
|
||||
new ExistCheck('contract_template_obligation'),
|
||||
new ContractTemplateObligationDependencyCheck($data['depend_contract_template_obligation_id'] ?? [])
|
||||
],
|
||||
'depend_contract_template_obligation_id' => [
|
||||
'required',
|
||||
new UnderCheck('contract_template_obligation'),
|
||||
new ExistCheck('contract_template_obligation')
|
||||
new ExistCheck('contract_template_obligation'),
|
||||
new ContractTemplateObligationDependencyCheck($data['contract_template_obligation_id'] ?? [])
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ class ContractTemplateObligationModule extends BaseController
|
||||
{
|
||||
General::storeCachePerviousQuery($request->query(), 'contract_template_obligation_query');
|
||||
|
||||
$not_hash_id = $not_id = $request->get('not_id', []);
|
||||
$contract_template_hash_id = $contract_template_id = $request->get('contract_template_id', []);
|
||||
|
||||
$name = $request->get('name', null);
|
||||
@@ -40,6 +41,11 @@ class ContractTemplateObligationModule extends BaseController
|
||||
|
||||
$query = ContractTemplateObligation::query();
|
||||
|
||||
if (!empty($not_id)) {
|
||||
$not_id = Hasher::decodeArray('contract_template_obligations', $not_id);
|
||||
$query->whereNotIn('id', $not_id);
|
||||
}
|
||||
|
||||
if (!empty($contract_template_id)) {
|
||||
$contract_template_id = Hasher::decodeArray('contract_templates', $contract_template_id);
|
||||
$query->whereIn('contract_template_id', $contract_template_id);
|
||||
|
||||
Reference in New Issue
Block a user