コード例 #1
0
ファイル: Invest.php プロジェクト: wuwenhan/huoqiwang
 /**
  * Auther:langxi
  *
  *更新总投资记录
  */
 private static function total_log($member_id, $money)
 {
     $order = Order::find()->where(['member_id' => $member_id])->asArray()->count();
     if ($order > 1) {
         $common = Common::findOne('1');
         $common->invest_sum = $common['invest_sum'] + $money;
         $common->invest_times = $common['invest_times'] + 1;
         $common = $common->save();
     } else {
         $common = Common::findOne('1');
         $common->invest_sum = $common['invest_sum'] + $money;
         $common->invest_people = $common['invest_people'] + 1;
         $common->invest_times = $common['invest_times'] + 1;
         $common = $common->save();
     }
     if (!$common) {
         $result = array('errorNum' => '1', 'errorMsg' => '更新总投资记录失败', 'data' => null);
         return $result;
     } else {
         return false;
     }
 }
コード例 #2
0
ファイル: Invest.php プロジェクト: wuwenhan/huoqiwang
 /**
  * Auther:langxi
  *
  *更新总投资记录
  */
 private static function total_log($member_id, $money)
 {
     $order = Order::find()->where(['member_id' => $member_id])->asArray()->count();
     if ($order > 1) {
         $common = Common::findOne('1');
         $common->invest_sum = $common['invest_sum'] + $money;
         $common->invest_times = $common['invest_times'] + 1;
         $common = $common->save();
     } else {
         $common = Common::findOne('1');
         $common->invest_sum = $common['invest_sum'] + $money;
         $common->invest_people = $common['invest_people'] + 1;
         $common->invest_times = $common['invest_times'] + 1;
         $common = $common->save();
     }
     if (!$common) {
         throw new ErrorException('更新总投资记录失败', 6002);
     } else {
         return true;
     }
 }