瀏覽代碼

get database

hajar
Siti Hajar Ibrahim 5 年之前
父節點
當前提交
dd02830fda
共有 1 個文件被更改,包括 16 次插入13 次删除
  1. 16
    13
      app/Http/Controllers/Controller.php

+ 16
- 13
app/Http/Controllers/Controller.php 查看文件

$subscribers = Subscriber::all(); $subscribers = Subscriber::all();


foreach ($subscribers as $key => $a) { foreach ($subscribers as $key => $a) {
if($a->unit_no != '' || $a->unit_no != null){
$a->unit_no = strtoupper($a->unit_no);
if ($a->unit_no != '' || $a->unit_no != null) {
$a->unit_no = strtoupper($a->unit_no);
} }
if ($a->building_name != '' || $a->building_name != null) { if ($a->building_name != '' || $a->building_name != null) {
$a->building_name = strtoupper($a->building_name); $a->building_name = strtoupper($a->building_name);
if ($a->street != '' || $a->street != null) { if ($a->street != '' || $a->street != null) {
$a->street = strtoupper($a->street); $a->street = strtoupper($a->street);
} }
if ($a->city != ''|| $a->city != null) {
if ($a->city != '' || $a->city != null) {
$a->city = strtoupper($a->city); $a->city = strtoupper($a->city);
} }
if ($a->state != ''|| $a->state != null) {
if ($a->state != '' || $a->state != null) {
$a->state = strtoupper($a->state); $a->state = strtoupper($a->state);
} }
$a->save();
$a->save();
} }


return "Done standardize city in DB"; return "Done standardize city in DB";


if (!empty($work_order)) { if (!empty($work_order)) {
$form_submitted = Form::where('_id', $work_order->_id)->first(); $form_submitted = Form::where('_id', $work_order->_id)->first();
$form_submitted->customer_category = $r->category; $form_submitted->customer_category = $r->category;
$form_submitted->save(); $form_submitted->save();
} }
$product = Product::where('formT', 'R')->where('speed', '50')->first(); $product = Product::where('formT', 'R')->where('speed', '50')->first();
$product->promotion_price = "69"; $product->promotion_price = "69";
$product->save(); $product->save();
$product1 = Product::where('formT','R')->where('speed','100')->first();
$product1 = Product::where('formT', 'R')->where('speed', '100')->first();
$product1->promotion_price = "89"; $product1->promotion_price = "89";
$product1->save(); $product1->save();




public function resetDocket(Request $request) public function resetDocket(Request $request)
{ {
$docket = Docket::where('docket_id',$request->docket_id)->first();
$docket = Docket::where('docket_id', $request->docket_id)->first();


$work_order = WorkOrder::where('wo',$docket->work_order_id)->first();
$work_order = WorkOrder::where('wo', $docket->work_order_id)->first();
$work_order->docket_id = ""; $work_order->docket_id = "";
$work_order->status = "Pending Installer"; $work_order->status = "Pending Installer";
$work_order->save(); $work_order->save();


$claim = DealerClaim::where('docket',$request->docket_id)->first();
if(!empty($claim)){
$claim = DealerClaim::where('docket', $request->docket_id)->first();
if (!empty($claim)) {
$claim->forceDelete(); $claim->forceDelete();
} }


{ {
$subscriber = Subscriber::where('subscriber_id', 'CBB-7XCYC5R')->first(); $subscriber = Subscriber::where('subscriber_id', 'CBB-7XCYC5R')->first();


return $subscriber;
$subscriber->front_ic = "/document/CBB-7XCYC5R/frontic.jpg";
$subscriber->back_ic = "/document/CBB-7XCYC5R/backic.jpg";
$subscriber->save();


return $subscriber;
} }
} }

Loading…
取消
儲存