execute two methods from the codeigniter driver

0

I'm working with codeigniter, and I have a method which goes to two functions of the model, the problem is that it does not do what it says in one of those functions, it only does the first.

controller code (the method that calls two functions of the model):

  public function approvedIncidence()
  {

    $postData = $this->input->post();
    $postNameAdvocate = $postData['advocateName'];
    $postDate = $postData['datepicker'];
    $postNewIn = $postData['newIn'];
    $postNewOut = $postData['newOut'];


    $postNumCase = $postData['CaseNumber'];
    $nameSesion = $this->session->name;
    $separation = ": ";
    $break = "\n";
    $postComment1 = $postData['Comment'];
    $postCommentNew = $postData['newComment'];
    $postComment = 
    $postComment1.$nameSesion.$separation.$postCommentNew.$break;
    $this->ol_model->approvedIncidence($postNumCase, 
    $postComment,$postDate,$postNewIn, $postNewOut,$postNameAdvocate);
    $this->ol_model->approvedIncidenceSch($postDate,$postNewIn, 
    $postNewOut,$postNameAdvocate);
    redirect('Admin/solvedIncidence');

     }

As you can see in the part where ol_model says I am referring to the functions of the model.

code of model functions:

   public function approvedIncidence($request_num_case, $request_comment){
    $date = date("Y-m-d");
    $array = array(
    'request_unread_rta' => '1',
    'request_resolution' => 'approved',
    'request_auth_date' => $date,
    'request_updated_by' => $this->session->name,
    'request_comment' => $request_comment
     );

     $this->db->where('request_num_case', $request_num_case);
     $this->db->update('ol_request', $array);

     }

This is the one that does not execute, it does not update the fields of the array_sch:

code:

     public function approvedIncidenceSch($dates,$postNewIn, 
     $postNewOut,$postNameAdvocate){
     $array_sch = array('sch_actual_in' => $postNewIn,
     'sch_actual_out' => $postNewOut
      );
     $this->db->where('fk_roster_salesforcename', $postNameAdvocate);
     $this->db->where('sch_date', $dates);
     $this->db->update('ol_schedules', $array_sch);

       }
    
asked by user80520 04.04.2018 в 16:31
source

0 answers