|
@@ -5,6 +5,7 @@ namespace App\Models;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Models\BaseModel;
|
|
use App\Models\BaseModel;
|
|
|
|
+use Illuminate\Support\Arr;
|
|
|
|
|
|
class StoreOrder extends BaseModel
|
|
class StoreOrder extends BaseModel
|
|
{
|
|
{
|
|
@@ -42,6 +43,26 @@ class StoreOrder extends BaseModel
|
|
return (array) @$selectedOptions->tests;
|
|
return (array) @$selectedOptions->tests;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function testsRequested(){
|
|
|
|
+ $tests = $this->tests();
|
|
|
|
+ $data = [];
|
|
|
|
+ foreach($tests as $key=>$value){
|
|
|
|
+ if($value){
|
|
|
|
+ array_push($data, $key);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function testsRequestedInHumanReadable(){
|
|
|
|
+ $data = [];
|
|
|
|
+ $tests = $this->testsRequested();
|
|
|
|
+ foreach($tests as $test){
|
|
|
|
+ array_push($data, config('constants.tests.'.$test));
|
|
|
|
+ }
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
public function total(){
|
|
public function total(){
|
|
$detail = json_decode($this->detail_json);
|
|
$detail = json_decode($this->detail_json);
|