This commit is contained in:
franknstayn
2021-11-05 12:33:51 +08:00
parent 3aa67616aa
commit 705dd3795e
3 changed files with 33 additions and 19 deletions

View File

@@ -527,8 +527,17 @@ class PaypalController extends Controller
$other_email[] = $userdata->other_email; $other_email[] = $userdata->other_email;
} }
// if ($other_email[0] != null) {
// $other_email = implode(", ", $other_email);
// $email_cc = "orders@merchbay.com" . "," . $other_email;
// } else {
// $email_cc = "orders@merchbay.com";
// }
if ($other_email[0] != null) { if ($other_email[0] != null) {
$other_email = implode(", ", $other_email); $other_email = implode(", ", array_filter($other_email, function ($value) {
return !is_null($value) && $value !== '';
}));
$email_cc = "orders@merchbay.com" . "," . $other_email; $email_cc = "orders@merchbay.com" . "," . $other_email;
} else { } else {
$email_cc = "orders@merchbay.com"; $email_cc = "orders@merchbay.com";

View File

@@ -1,51 +1,56 @@
<?php namespace App\Models\paypal; <?php
namespace App\Models\paypal;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
class PayPalModel extends Model { class PayPalModel extends Model
{
function insertToPaypalDetails($data){ function insertToPaypalDetails($data)
{
$i = DB::table('payment_details')->insertGetId($data); $i = DB::table('payment_details')->insertGetId($data);
return $i; return $i;
} }
function insertToOrders($ck){
function insertToOrders($ck)
{
// $i = DB::table('orders')->insert($data); // $i = DB::table('orders')->insert($data);
$pdo = DB::connection()->getPdo(); $pdo = DB::connection()->getPdo();
$query = $pdo->prepare("INSERT INTO orders SELECT * FROM cart_tmp where CartKey = '$ck'"); $query = $pdo->prepare("INSERT INTO orders SELECT * FROM cart_tmp where CartKey = '$ck'");
$i = $query->execute(); $i = $query->execute();
return $i; return $i;
} }
function insertShippingAddress($data){ function insertShippingAddress($data)
{
$i = DB::table('shipping_addresses')->insert($data); $i = DB::table('shipping_addresses')->insert($data);
return $i; return $i;
} }
function getLastIdPaymentDetails(){ function getLastIdPaymentDetails()
{
$i = DB::table('payment_details') $i = DB::table('payment_details')
->orderby('Id', 'DESC') ->orderby('Id', 'DESC')
->take(1) ->take(1)
->get(); ->get();
// var_dump($i);
return $i; return $i;
} }
function checkCartKey($ck){ function checkCartKey($ck)
{
$i = DB::table('payment_details') $i = DB::table('payment_details')
->where('CartKey', $ck) ->where('CartKey', $ck)
// ->take(1) ->get();
->get();
// var_dump($i);
return $i; return $i;
} }
} }

View File

@@ -34,7 +34,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">Store URL</label> <label class="col-sm-4 control-label">Store URL</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input type="text" class="form-control" disabled value="{{ $store_array[0]->StoreUrl }}" name="store_url" placeholder="Store URL" reqiured="required" /> <input type="text" class="form-control" readonly value="{{ $store_array[0]->StoreUrl }}" name="store_url" placeholder="Store URL" reqiured="required" />
<input type="hidden" class="form-control" value="{{ $store_array[0]->StoreUrl }}" name="orig_store_url" reqiured="required" /> <input type="hidden" class="form-control" value="{{ $store_array[0]->StoreUrl }}" name="orig_store_url" reqiured="required" />
</div> </div>
</div> </div>