User Order step1
This commit is contained in:
parent
eb55b01b0d
commit
a5db985ae8
90 changed files with 6439 additions and 421 deletions
|
|
@ -6,6 +6,7 @@ use App\Models\Category;
|
|||
use App\Models\Country;
|
||||
use App\Models\Product;
|
||||
use App\Models\ShippingCountry;
|
||||
use App\Models\ShoppingUser;
|
||||
use App\Models\UserLevel;
|
||||
use App\User;
|
||||
|
||||
|
|
@ -299,4 +300,21 @@ class HTMLHelper
|
|||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public static function getUserCustomerOptions($id, $all=false){
|
||||
$values = ShoppingUser::select(['id', 'billing_firstname', 'billing_lastname', 'billing_email', 'number'])
|
||||
->where('shopping_users.member_id', '=', \Auth::user()->id)->get();
|
||||
$ret = "";
|
||||
if($all){
|
||||
$ret .= '<option value="">'.__('please select').'</option>\n';
|
||||
}
|
||||
foreach ($values as $value){
|
||||
dump($value);
|
||||
$attr = ($value->id == $id) ? 'selected="selected"' : '';
|
||||
$to = $value->billing_firstname." ".$value->billing_lastname." | ".$value->billing_email;
|
||||
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$to.' #'.$value->number.'</option>\n';
|
||||
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
78
app/Services/SysLog.php
Normal file
78
app/Services/SysLog.php
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
namespace App\Services;
|
||||
|
||||
use App\Mail\MailSyS;
|
||||
use App\Models\Logger;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
|
||||
class SysLog
|
||||
{
|
||||
|
||||
|
||||
/* protected $user_id;
|
||||
protected $model;
|
||||
protected $model_id;
|
||||
protected $message;
|
||||
protected $action;
|
||||
protected $channel;
|
||||
protected $level;*/
|
||||
|
||||
protected $log;
|
||||
|
||||
public $levelTypes = [
|
||||
1 => 'debug',
|
||||
2 => 'info',
|
||||
3 => 'notice',
|
||||
4 => 'warning',
|
||||
5 => 'error',
|
||||
6 => 'critical',
|
||||
7 => 'alert',
|
||||
];
|
||||
|
||||
function __construct($action = null, $channel = 'default', $level = 1)
|
||||
{
|
||||
$this->log = new Logger();
|
||||
$this->log->action = $action;
|
||||
$this->log->channel = $channel;
|
||||
$this->log->level = $level;
|
||||
}
|
||||
|
||||
public static function action($action = null, $channel = 'default', $level = 1)
|
||||
{
|
||||
//Return new instance of this model
|
||||
return new self($action, $channel, $level);
|
||||
}
|
||||
|
||||
public function setModel($id, $model){
|
||||
$this->log->model_id = $id;
|
||||
$this->log->model = $model;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUserId($user_id){
|
||||
$this->log->user_id = $user_id;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setMessage($message){
|
||||
$this->log->message = $message;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function save(){
|
||||
$this->log->save();
|
||||
//send Mail
|
||||
if($this->log->level >= 3){
|
||||
$mail = config('app.info_test_mail');
|
||||
Mail::to($mail)->send(new MailSyS($this->log, 'log'));
|
||||
}
|
||||
}
|
||||
|
||||
public function getLevelType(){
|
||||
return $this->levelTypes[$this->log->level];
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -17,4 +17,5 @@ class UserService
|
|||
while(!$unique);
|
||||
return $confirmation_code;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue