m3 Security Fixes
This commit is contained in:
@@ -2,16 +2,18 @@
|
||||
|
||||
namespace Modules\M3\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Config;
|
||||
|
||||
class ShipTo extends Model
|
||||
{
|
||||
protected $table = 'ICM665M';
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $primaryKey = ['AUSHSHZP', 'AUSHWHS'];
|
||||
|
||||
protected $uniqueKey = ['AUSHSHZP', 'AUSHWHS'];
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $fillable = [
|
||||
@@ -23,7 +25,7 @@ class ShipTo extends Model
|
||||
'AUSHSHST',
|
||||
'AUSHSHZP',
|
||||
'AUSHSHCT',
|
||||
'AUSHWHS'
|
||||
'AUSHWHS',
|
||||
];
|
||||
|
||||
public function save(array $options = [])
|
||||
@@ -42,11 +44,11 @@ class ShipTo extends Model
|
||||
{
|
||||
$query = self::query();
|
||||
|
||||
# Check if the combination of AUSHSHZP and AUSHWHS already exists
|
||||
// Check if the combination of AUSHSHZP and AUSHWHS already exists
|
||||
$existingRecord = $query->where('AUSHSHZP', $this->AUSHSHZP)
|
||||
->where('AUSHWHS', $this->AUSHWHS);
|
||||
|
||||
# If this is an existing record being updated, exclude itself from the check
|
||||
// If this is an existing record being updated, exclude itself from the check
|
||||
if ($this->exists) {
|
||||
$existingRecord->where($this->getKeyName(), '!=', $this->getKey());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user