|
@@ -405,10 +405,12 @@ class DreamController extends Controller
|
|
$user_care_dream = UserCareDream::where('user_id', $user->id)->where('dream_id', $dream_id)->first();
|
|
$user_care_dream = UserCareDream::where('user_id', $user->id)->where('dream_id', $dream_id)->first();
|
|
$is_collection = empty($user_care_dream) ? 0 :1 ;
|
|
$is_collection = empty($user_care_dream) ? 0 :1 ;
|
|
$setting = BaseSettingsModel::where('category','score')->select('key','value')->first();
|
|
$setting = BaseSettingsModel::where('category','score')->select('key','value')->first();
|
|
- $a = count($setting) > 0 ? $setting->key : '';
|
|
|
|
|
|
+ $a = count($setting) > 0 ? $setting->key : 0;
|
|
$b = intval((time()-strtotime($dream->created_at))/60) ;
|
|
$b = intval((time()-strtotime($dream->created_at))/60) ;
|
|
- $c = count($setting) > 0 ? $setting->value : '';
|
|
|
|
- //Todo 支持乘数目公式
|
|
|
|
|
|
+ $c = count($setting) > 0 ? $setting->value : 0;
|
|
|
|
+ $n = count($setting) > 0 ? $setting->sort : 0;
|
|
|
|
+ //Todo 支持乘数目公式 pow(x,y)
|
|
|
|
+// exp(x) $number = N*exp(-a*(pow(t,1/b)))+1
|
|
$number =round( -$a * $b + $c,1);
|
|
$number =round( -$a * $b + $c,1);
|
|
if ($number <= 1) $number = 1;
|
|
if ($number <= 1) $number = 1;
|
|
|
|
|
|
@@ -478,17 +480,6 @@ class DreamController extends Controller
|
|
if (!$ok) {
|
|
if (!$ok) {
|
|
return $this->error(ErrorCode::MERCHANT_SERVICE_STATUS_INVALID);
|
|
return $this->error(ErrorCode::MERCHANT_SERVICE_STATUS_INVALID);
|
|
}
|
|
}
|
|
- // 记录充值记录 新增系统消息
|
|
|
|
- $data = [
|
|
|
|
- 'from_id' =>$user->id,
|
|
|
|
- 'to_id' => $user_id,
|
|
|
|
- 'from_amount' => $coin,
|
|
|
|
- 'to_amount' => $coin,
|
|
|
|
- 'from_type' => AccountLog::TYPE_COIN,
|
|
|
|
- 'to_type' => AccountLog::TYPE_COIN,
|
|
|
|
- 'op' => AccountLog::OP_SUPPORT,
|
|
|
|
- ];
|
|
|
|
- AccountLog::create($data);
|
|
|
|
$message = UserInfoModel::find($user->id)->nickname.'为你的梦想支持了'.$coin.'梦想币';
|
|
$message = UserInfoModel::find($user->id)->nickname.'为你的梦想支持了'.$coin.'梦想币';
|
|
$info = [
|
|
$info = [
|
|
'to_user_id' => $user_id,
|
|
'to_user_id' => $user_id,
|