柳建 9 ヶ月 前
コミット
d99b9aa1f8
1 ファイル変更7 行追加5 行削除
  1. 7 5
      application/api/controller/Index.php

+ 7 - 5
application/api/controller/Index.php

@@ -81,7 +81,7 @@ class Index extends Api
         if (!$userdata) {
         $returndata= 'no data';
         } else {
-            Db::startTrans();
+           // Db::startTrans();
             $userids = array_column($userdata, 'id');
             $userlink = db('userlink')
                 ->join(['fa_link'], 'fa_userlink.link_id = fa_link.id')
@@ -106,14 +106,16 @@ class Index extends Api
                         'uid' => $val['uid'],
                         'status' => 0
                     ];
-                    $userlinkdata[]=['id'=>$val['userlinkid'],'income'=>$val['userlinkid']+$income];
+                    $userlinkdata[]=['id'=>$val['userlinkid'],'income'=>$val['income']+$income];
 
                 }
-                $this->userlinkModel->saveAll($userlinkdata);
-                $this->recordModel->saveAll($savedata);
+                print_r($userlinkdata);
+                print_r($savedata);
+//                $this->userlinkModel->saveAll($userlinkdata);
+//                $this->recordModel->saveAll($savedata);
                 $returndata= 'insert ' . count($savedata) . ' record';
             }
-            Db::commit();
+           // Db::commit();
         }
         return $returndata;
     }