Example #1
0
 public function add($positive, $negative, $table, $table_id, $account_id)
 {
     $oo = Model::Offreout()->find((int) $table_id);
     if ($oo) {
         $advice = Model::Advice()->firstOrcreate(['table' => $table, 'table_id' => $table_id, 'account_id' => $account_id, 'reseller_id' => (int) $oo->reseller_id]);
         $advice->positive = $positive;
         $advice->negative = $negative;
         $advice->save();
         return $advice->id;
     }
     return false;
 }