@@ -122,6 +122,9 @@ class PostController extends Controller
*/
public function hide(Request $request)
{
+ $h = date('h');
+ $H = date('H');
+ return intval($h);
$validator = Validator::make($request->all(), [
'id' => 'required|integer',
]);
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * Created by PhpStorm.
+ * User: Administrator
+ * Date: 2019/6/6
+ * Time: 18:05
+ */
+namespace App\Traits;
+use Illuminate\Support\Facades\Redis;
+trait PostTrait
+{
+ //预计可获得彩虹豆数
+ public function availableBean()
+ {
+ $bean = Redis::get('yesterday_post_create_bean');
+ $count = Redis::get('yesterday_post_count');
+ $num = 1000;
+ if($bean && $count){
+ $num = $bean / $count;
+ }
+ $t = $h * 60 / 720 + 2;
+ if(in_array(intval($H), [9,10,11,12,17.18,19,20,21])){
+ $t += 0.5;
+ return intval($num * $t);
+ //待收获彩虹豆数
+ public function willCollectBean()
+ return 22;
+}
@@ -70,7 +70,7 @@ class CreateTablePostData extends Migration
$table->integer('will_collect_bean')
->default(0)
- ->comment('待收货彩虹豆数');
+ ->comment('待收获彩虹豆数');
$table->integer('collect_bean')