本文整理汇总了PHP中Carbon\Carbon::NOW方法的典型用法代码示例。如果您正苦于以下问题:PHP Carbon::NOW方法的具体用法?PHP Carbon::NOW怎么用?PHP Carbon::NOW使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carbon\Carbon
的用法示例。
在下文中一共展示了Carbon::NOW方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createJV
public static function createJV($data)
{
$jv = $data['JV'];
$entries = json_decode($data['entries']);
$userID = $data['userID'];
$JVNo = JVoucher::JVnum();
$JVNumSeries = JVoucher::getJVNum();
$ID = $JVNumSeries[0]->idNum;
$Voucher = $JVNumSeries[0]->numSeries + 1;
DB::table('tbl_series')->where('idNum', $ID)->update(['numSeries' => $Voucher]);
$id = DB::table('tbl_gj')->insertGetId(['JVNum' => $JVNo[0]->JV, 'transDate' => Carbon::NOW(), 'prepBy' => $userID, 'particulars' => $jv['particulars']]);
for ($i = 0; $i < count($entries); $i++) {
$var = $entries[$i];
$amount = isset($var->DB) && $var->DB > 0 ? $var->DB : $var->CR;
if (isset($var->DB) && !empty($var->DB)) {
$ID = $var->title;
} else {
$ID = null;
}
if (isset($var->CR) && !empty($var->CR)) {
$ID2 = $var->title;
} else {
$ID2 = null;
}
DB::table('tbl_journalEntries')->insert(['JID' => $id, 'idAcctTitleDB' => $ID, 'idAcctTitleCR' => $ID2, 'amount' => $amount]);
}
if ($id) {
$ids['success'] = 'true';
$ids['msg'] = 'New Journal Voucher Entry has been saved.';
} else {
$ids['success'] = 'false';
$ids['msg'] = 'WARNING: Unknown error occur while saving the record';
}
return $ids;
}
示例2: createPO
public static function createPO($data)
{
$po = $data['PO'];
$userID = $data['userID'];
$entries = json_decode($data['entries']);
$POSeries = PurchaseOrders::PONumseries();
$PONo = PurchaseOrders::getPONum();
$ID = $PONo[0]->idNum;
$Voucher = $PONo[0]->numSeries + 1;
DB::table('tbl_series')->where('idNum', $ID)->update(['numSeries' => $Voucher]);
$result = DB::table('tbl_po')->insertGetId(['po_num' => $POSeries[0]->PO, 'supplier' => $po['supplier'], 'branch' => $po['branch'], 'PO_date' => Carbon::NOW(), 'bank' => $po['bank'], 'purchasing_agent' => $po['POAgent'], 'requestedby' => $po['brName'], 'mop' => $po['mop'], 'userID' => $userID]);
for ($i = 0; $i < count($entries); $i++) {
$var = $entries[$i];
$quantity = $var->qty;
$unit = $var->unit;
$Items = $var->Items;
$unitPrice = $var->unitPrice;
$total = $var->total;
DB::table('tbl_po_items')->insert(['poID' => $result, 'items' => $Items, 'qty' => $quantity, 'unit' => $unit, 'unit_price' => $unitPrice, 'total' => $total]);
}
if ($result) {
$results['success'] = 'true';
$results['msg'] = 'New Purchase Order has been saved.';
} else {
$results['success'] = 'false';
$results['msg'] = 'WARNING: Unknown error occur while saving the record';
}
return $results;
}
示例3: updateAPV
public static function updateAPV($id, $data)
{
$apv = $data['APV'];
$userID = $data['userID'];
$result = DB::table('tbl_apv')->where('apvID', $id)->update(['transDate' => Carbon::NOW(), 'particulars' => $apv['particulars'], 'prepBy' => $userID]);
if ($result) {
$results['success'] = 'true';
$results['msg'] = 'Account Payable Voucher has been updated.';
} else {
$results['success'] = 'false';
$results['msg'] = 'WARNING: Unknown error occur while updating APV.';
}
return $results;
}
示例4: saveOR
public static function saveOR($data)
{
$OR = $data['OR'];
$userID = $data['userID'];
$result = DB::insert('INSERT INTO tbl_OR(ORNum,transDate,branch,amount,particulars,userID) VALUES (?,?,?,?,?,?)', [$OR['ORNum'], Carbon::NOW(), $OR['payer'], $OR['amount'], $OR['particulars'], $userID]);
if ($result) {
$results['success'] = 'true';
$results['msg'] = 'Offcial Receipt has been saved';
} else {
$results['success'] = 'false';
$results['msg'] = 'WARNING: Unknown error occur while saving the record';
}
return $results;
}
示例5: createAsset
public static function createAsset($data)
{
$Asset = $data['asset'];
$userID = $data['userID'];
$result = DB::insert('INSERT INTO tbl_assetinfo(itemName,cost,datePurchased,estLife,qty,categoryID,postedDate,postedBy) VALUES(?,?,?,?,?,?,?,?)', [$Asset['itemName'], $Asset['cost'], $Asset['datePurchased'], $Asset['estLife'], $Asset['qty'], $Asset['category'], Carbon::NOW(), $userID]);
if ($result) {
$results['success'] = 'true';
$results['msg'] = 'New Asset Item has been added successfully.';
} else {
$results['success'] = 'false';
$results['msg'] = 'WARNING: Unknown error occur while saving the record';
}
return $results;
}
示例6: updateCDV
public static function updateCDV($id, $data)
{
$CDV = $data['CDV'];
$userID = $data['userID'];
$result = DB::table('tbl_cdv')->where('cdvID', $id)->update(['payee' => $CDV['payee'], 'address' => $CDV['address'], 'chkDate' => $CDV['dt'], 'bankID' => $CDV['bank'], 'amount' => $CDV['amount'], 'chkNO' => $CDV['chkNO'], 'particular' => $CDV['particular'], 'transDate' => Carbon::NOW(), 'prepBy' => $userID]);
if ($result) {
$results['success'] = 'true';
$results['msg'] = 'Check Disbursement Voucher has been updated.';
} else {
$results['success'] = 'false';
$results['msg'] = 'WARNING: Unknown error occur while updating CDV.';
}
return $results;
}