first commit
This commit is contained in:
41
app/Models/paypal/PayPalModel.php
Normal file
41
app/Models/paypal/PayPalModel.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php namespace App\Models\paypal;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class PayPalModel extends Model {
|
||||
|
||||
function insertToPaypalDetails($data){
|
||||
|
||||
$i = DB::table('payment_details')->insertGetId($data);
|
||||
return $i;
|
||||
}
|
||||
|
||||
|
||||
function insertToOrders($ck){
|
||||
|
||||
// $i = DB::table('orders')->insert($data);
|
||||
$pdo = DB::connection()->getPdo();
|
||||
|
||||
$query = $pdo->prepare("INSERT INTO orders SELECT * FROM cart_tmp where CartKey = '$ck'");
|
||||
$i = $query->execute();
|
||||
|
||||
return $i;
|
||||
}
|
||||
|
||||
function insertShippingAddress($data){
|
||||
|
||||
$i = DB::table('shipping_addresses')->insert($data);
|
||||
return $i;
|
||||
}
|
||||
|
||||
function getLastIdPaymentDetails(){
|
||||
|
||||
$i = DB::table('payment_details')
|
||||
->orderby('Id', 'DESC')
|
||||
->take(1)
|
||||
->get();
|
||||
// var_dump($i);
|
||||
return $i;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user