bitfix and add sql file

dev
Aji Kamaludin 1 year ago
parent f48e76eda0
commit a3f95b3e8a
No known key found for this signature in database
GPG Key ID: 19058F67F0083AD3

@ -3,6 +3,7 @@
## Note
- [ ] expired point
- [ ] like query must use ? and change to lower case or somethink else
## Front

@ -24,10 +24,10 @@ class CustomerController extends Controller
if ($request->q != '') {
$query->where(function ($query) use ($request) {
$query->where('name', 'ilike', "%$request->q%")
->orWhere('fullname', 'ilike', "%$request->q%")
->orWhere('email', 'ilike', "%$request->q%")
->orWhere('phone', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%")
->orWhere('fullname', 'like', "%$request->q%")
->orWhere('email', 'like', "%$request->q%")
->orWhere('phone', 'like', "%$request->q%");
});
}
@ -115,8 +115,8 @@ class CustomerController extends Controller
public function update(Request $request, Customer $customer)
{
$request->validate([
'email' => 'nullable|email|unique:customers,email,'.$customer->id,
'username' => 'required|string|min:5|alpha_dash|unique:customers,username,'.$customer->id,
'email' => 'nullable|email|unique:customers,email,' . $customer->id,
'username' => 'required|string|min:5|alpha_dash|unique:customers,username,' . $customer->id,
'password' => 'nullable|string|min:8',
'name' => 'required|string',
'fullname' => 'required|string',

@ -44,10 +44,10 @@ class CustomerMitraController extends Controller
if ($request->q != '') {
$query->where(function ($query) use ($request) {
$query->where('name', 'ilike', "%$request->q%")
->orWhere('fullname', 'ilike', "%$request->q%")
->orWhere('email', 'ilike', "%$request->q%")
->orWhere('phone', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%")
->orWhere('fullname', 'like', "%$request->q%")
->orWhere('email', 'like', "%$request->q%")
->orWhere('phone', 'like', "%$request->q%");
});
}
@ -87,7 +87,7 @@ class CustomerMitraController extends Controller
$locations = Location::query();
if ($request->location_q != '') {
$locations->where('name', 'ilike', "%$request->location_q%");
$locations->where('name', 'like', "%$request->location_q%");
}
return inertia('CustomerMitra/Form', [
@ -205,7 +205,7 @@ class CustomerMitraController extends Controller
$locations = Location::query();
if ($request->location_q != '') {
$locations->where('name', 'ilike', "%$request->location_q%");
$locations->where('name', 'like', "%$request->location_q%");
}
return inertia('CustomerMitra/Form', [

@ -20,11 +20,11 @@ class DepositController extends Controller
if ($request->q != '') {
$deposits->where(function ($query) use ($request) {
$query->where('description', 'ilike', "%$request->q%")
$query->where('description', 'like', "%$request->q%")
->orWhereHas('customer', function ($query) use ($request) {
$query->where('fullname', 'ilike', "%$request->q%")
->orWhere('email', 'ilike', "%$request->q%")
->orWhere('phone', 'ilike', "%$request->q%");
$query->where('fullname', 'like', "%$request->q%")
->orWhere('email', 'like', "%$request->q%")
->orWhere('phone', 'like', "%$request->q%");
});
});
}

@ -13,7 +13,7 @@ class LocationController extends Controller
$query = Location::orderBy('updated_at', 'desc');
if ($request->q != '') {
$query->where('name', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%");
}
return inertia('Location/Index', [

@ -19,8 +19,8 @@ class LocationProfileController extends Controller
}
if ($request->q != '') {
$query->where('name', 'ilike', "%$request->q%")
->orWhere('display_note', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%")
->orWhere('display_note', 'like', "%$request->q%");
}
return inertia('LocationProfile/Index', [

@ -22,11 +22,11 @@ class PaylaterController extends Controller
if ($request->q != '') {
$deposits->where(function ($query) use ($request) {
$query->where('description', 'ilike', "%$request->q%")
$query->where('description', 'like', "%$request->q%")
->orWhereHas('customer', function ($query) use ($request) {
$query->where('fullname', 'ilike', "%$request->q%")
->orWhere('email', 'ilike', "%$request->q%")
->orWhere('phone', 'ilike', "%$request->q%");
$query->where('fullname', 'like', "%$request->q%")
->orWhere('email', 'like', "%$request->q%")
->orWhere('phone', 'like', "%$request->q%");
});
});
}

@ -20,7 +20,7 @@ class RoleController extends Controller
$query = Role::query()->with(['users']);
if ($request->q) {
$query->where('name', 'ilike', "%{$request->q}%");
$query->where('name', 'like', "%{$request->q}%");
}
$query->orderBy('created_at', 'desc');

@ -39,11 +39,11 @@ class SaleController extends Controller
->withCount(['items']);
if ($request->q != '') {
$query->where('code', 'ilike', "%$request->q%")
$query->where('code', 'like', "%$request->q%")
->orWhereHas('customer', function ($query) use ($request) {
$query->where('name', 'ilike', "%$request->q%")
->orWhere('fullname', 'ilike', "%$request->q%")
->orWhere('username', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%")
->orWhere('fullname', 'like', "%$request->q%")
->orWhere('username', 'like', "%$request->q%");
});
}

@ -15,7 +15,7 @@ class UserController extends Controller
$query = User::query()->with(['role']);
if ($request->q) {
$query->where('name', 'ilike', "%{$request->q}%");
$query->where('name', 'like', "%{$request->q}%");
}
$query->orderBy('created_at', 'desc');
@ -70,9 +70,9 @@ class UserController extends Controller
{
$request->validate([
'name' => 'required|string|max:255',
'email' => 'required|email|unique:users,email,'.$user->id,
'email' => 'required|email|unique:users,email,' . $user->id,
'password' => 'nullable|string|max:255',
'username' => 'required|alpha_dash|unique:users,username,'.$user->id,
'username' => 'required|alpha_dash|unique:users,username,' . $user->id,
'phone_wa' => 'required|string',
'photo' => 'nullable|image',
]);

@ -19,7 +19,7 @@ class VoucherController extends Controller
$query = Location::orderBy('updated_at', 'desc');
if ($request->q != '') {
$query->where('name', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%");
}
return inertia('Voucher/Location', [
@ -37,8 +37,8 @@ class VoucherController extends Controller
}
if ($request->q != '') {
$query->where('name', 'ilike', "%$request->q%")
->orWhere('display_note', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%")
->orWhere('display_note', 'like', "%$request->q%");
}
return inertia('Voucher/Profile', [
@ -54,10 +54,10 @@ class VoucherController extends Controller
->where('location_profile_id', $profile->id);
if ($request->q != '') {
$query->where(function ($query) use ($request){
$query->where('username', 'ilike', "%$request->q%")
->orWhere('comment', 'ilike', "%$request->q%")
->orWhere('profile', 'ilike', "%$request->q%");
$query->where(function ($query) use ($request) {
$query->where('username', 'like', "%$request->q%")
->orWhere('comment', 'like', "%$request->q%")
->orWhere('profile', 'like', "%$request->q%");
});
}

@ -13,9 +13,9 @@ class CustomerController extends Controller
$query = Customer::orderBy('updated_at', 'desc');
if ($request->q != '') {
$query->where('name', 'ilike', "%$request->q%")
->orWhere('fullname', 'ilike', "%$request->q%")
->orWhere('username', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%")
->orWhere('fullname', 'like', "%$request->q%")
->orWhere('username', 'like', "%$request->q%");
}
if ($request->levels != '') {

@ -13,7 +13,7 @@ class LocationController extends Controller
$query = Location::orderBy('updated_at', 'desc');
if ($request->q != '') {
$query->where('name', 'ilike', "%$request->q%");
$query->where('name', 'like', "%$request->q%");
}
return $query->limit(100)->get();

@ -14,9 +14,9 @@ class LocationProfileController extends Controller
->orderBy('updated_at', 'desc');
if ($request->q != '') {
$query->where('name', 'ilike', "%$request->q%")
->orWhere('display_note', 'ilike', "%$request->q%")
->orWhereHas('location', fn ($q) => $q->where('name', 'ilike', "%$request->q%"));
$query->where('name', 'like', "%$request->q%")
->orWhere('display_note', 'like', "%$request->q%")
->orWhereHas('location', fn ($q) => $q->where('name', 'like', "%$request->q%"));
}
return $query->limit(100)->get();

@ -13,7 +13,7 @@ class RoleController extends Controller
$query = Role::query();
if ($request->q) {
$query->where('name', 'ilike', "%{$request->q}%");
$query->where('name', 'like', "%{$request->q}%");
}
return $query->limit(100)->get();

@ -51,7 +51,7 @@ class Setting extends Model
{
$data = Cache::get('settings');
if ($data == null) {
$settings = Setting::where('key', 'ilike', 'OPEN%')->get();
$settings = Setting::where('key', 'like', 'OPEN%')->get();
foreach ($settings as $setting) {
$data[$setting->key] = $setting->value;
}

@ -26,11 +26,11 @@ class DummySeeder extends Seeder
{
$this->info();
$this->banner();
$this->account();
$this->location();
$this->location_profile();
$this->voucher();
$this->deposit_location();
// $this->account();
// $this->location();
// $this->location_profile();
// $this->voucher();
// $this->deposit_location();
}
public function info()
@ -49,8 +49,8 @@ class DummySeeder extends Seeder
$images = ['1.webp', '2.webp', '3.webp'];
foreach ($images as $index => $image) {
Banner::create([
'title' => 'Banner '.$index,
'image' => 'sample/'.$image,
'title' => 'Banner ' . $index,
'image' => 'sample/' . $image,
'description' => '<h1>Banner </h1>',
]);
}
@ -109,7 +109,7 @@ class DummySeeder extends Seeder
$lp = LocationProfile::create([
'location_id' => $location->id,
'name' => 'Profile '.$quota,
'name' => 'Profile ' . $quota,
'quota' => $quota,
'display_note' => rand(0, 1) == 1 ? 'bisa semua' : null,
'expired' => rand(1, 3),

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save