Fixed order processing, broken after upgrade to Laravel 5.8

This commit is contained in:
Deon George
2019-06-13 14:32:34 +10:00
parent 9fa773d283
commit 4c5c43c390
13 changed files with 68 additions and 16 deletions

View File

@@ -9,6 +9,9 @@ use App\Traits\NextKey;
class Account extends Model
{
use NextKey;
const RECORD_ID = 'account';
public $incrementing = FALSE;
protected $table = 'ab_account';

View File

@@ -21,7 +21,7 @@ class AdslPlan extends Model
],
];
protected $order_model = ServiceAdsl::class;
protected $order_model = Service\Adsl::class;
public function product()
{

View File

@@ -4,12 +4,8 @@ namespace App\Models\Base;
use Illuminate\Database\Eloquent\Model;
use App\Traits\NextKey;
abstract class ServiceType extends Model
{
use NextKey;
public $timestamps = FALSE;
public $dateFormat = 'U';

View File

@@ -31,5 +31,5 @@ class PlanVoip extends Model
],
];
protected $order_model = ServiceVoip::class;
protected $order_model = Service\Voip::class;
}

View File

@@ -10,9 +10,11 @@ class Service extends Model
{
use NextKey;
public $incrementing = FALSE;
const RECORD_ID = 'service';
const CREATED_AT = 'date_orig';
const UPDATED_AT = 'date_last';
public $incrementing = FALSE;
protected $table = 'ab_service';
protected $with = ['product.descriptions','account.language'];
@@ -86,7 +88,7 @@ class Service extends Model
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function orderedby()
public function orderby()
{
return $this->belongsTo(Account::class);
}

View File

@@ -2,8 +2,14 @@
namespace App\Models\Service;
use App\Traits\NextKey;
class Adsl extends \App\Models\Base\ServiceType
{
use NextKey;
const RECORD_ID = 'service__adsl';
// @todo column service_id can be removed.
protected $table = 'ab_service__adsl';

View File

@@ -2,8 +2,14 @@
namespace App\Models\Service;
use App\Traits\NextKey;
class Domain extends \App\Models\Base\ServiceType
{
use NextKey;
const RECORD_ID = 'service__domain';
protected $table = 'ab_service__domain';
public function tld()

View File

@@ -2,8 +2,14 @@
namespace App\Models\Service;
use App\Traits\NextKey;
class Host extends \App\Models\Base\ServiceType
{
use NextKey;
const RECORD_ID = 'service__hosting';
protected $table = 'ab_service__hosting';
public function getNameAttribute()

View File

@@ -2,9 +2,16 @@
namespace App\Models\Service;
use App\Traits\NextKey;
class SSL extends \App\Models\Base\ServiceType
{
use NextKey;
const RECORD_ID = 'service__ssl';
protected $table = 'ab_service__ssl';
protected $_o = NULL;
public function tld()

View File

@@ -2,8 +2,14 @@
namespace App\Models\Service;
use App\Traits\NextKey;
class Voip extends \App\Models\Base\ServiceType
{
use NextKey;
const RECORD_ID = 'service__adsl';
protected $table = 'ab_service__voip';
public function getFullNameAttribute()