Example #1
0
 private function addRecord($out, $money, $in, $record_id, $date, $fee_record_id)
 {
     $model = new CreditRecord();
     $model['out_account_id'] = $out;
     $model['in_account_id'] = $in;
     $model['money'] = $money;
     $model['record_id'] = $record_id;
     $model['fee_record_id'] = $fee_record_id;
     $model['create_time'] = $date;
     $model->save();
 }
Example #2
0
 protected function insertCreditRecord($form, $id, $IO, $feeId = 0)
 {
     $search = new CreditRecord();
     $search['record_id'] = $id;
     $search['fee_record_id'] = $feeId;
     $flag = true;
     switch ($IO) {
         case 'i':
             $flag = $search->inRecord($form);
             break;
         case 'o':
             $flag = $search->outRecord($form);
             break;
     }
     if (!$flag) {
         return $this->render('success');
     } else {
         return $this->render('error', ['errors' => $accountRecordsearch->errors]);
     }
 }