Пример #1
0
 public function actionDaycommon()
 {
     $common = new Common();
     $daycommon = new Daycommon();
     $day = $common->find()->one();
     $daycommon->invest_sum = $day->invest_sum;
     $daycommon->invest_people = $day->invest_people;
     $daycommon->invest_times = $day->invest_times;
     $daycommon->create_at = $day->create_at;
     $daycommon->update_at = $day->update_at;
     $daycommon->save($day);
 }
Пример #2
0
 /**
  * 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;
     }
 }
Пример #3
0
 /**
  * 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;
     }
 }