YanaDH 7 năm trước cách đây
mục cha
commit
02a3460009

+ 1 - 1
miaomiao/www/templates/home/dream-detail.html

xqd
@@ -92,7 +92,7 @@
                             <h2>{{timer}}</h2>
                             <p>剩余时间</p>
                         </div>
-                        <div class="col" style="text-align:right">
+                        <div ng-if="user.id == dream.user.id" class="col" style="text-align:right">
                             <h2>{{dream.mark}}</h2>
                             <p>当前获得梦想分数</p>
                         </div>

+ 3 - 1
server/app/Http/Controllers/Admin/Account_logs/InfoController.php

xqd xqd
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\Admin\Account_logs;
 use App\Models\AccountLog;
 use Illuminate\Http\Request;
 use App\Http\Controllers\Admin\Controller;
+use Illuminate\Support\Facades\Log;
 
 class InfoController extends Controller
 {
@@ -12,7 +13,8 @@ class InfoController extends Controller
     {
         $id =  $request->id;
         $list = AccountLog::where('from_id',$id)->where('to_id',$id)
-            ->where('op','charge')->orderBy('id','desc')->paginate(20);
+            ->where('op','充值')->orderBy('id','desc')->paginate(20);
+        Log::info($list);
         return view('admin.account_log.index',compact('list'));
     }
 

+ 6 - 2
server/app/Http/Controllers/Admin/User/Cash/OutController.php

xqd xqd xqd
@@ -10,6 +10,7 @@ namespace App\Http\Controllers\Admin\User\Cash;
 use App\Http\Controllers\Admin\Controller;
 use App\Models\AccountLog;
 use App\Models\SystemInfoModel;
+use App\Models\UserCashOut;
 use App\Models\UserInfoModel;
 use Illuminate\Http\Request;
 use App\Repositories\Base\Criteria\OrderBy;
@@ -95,9 +96,12 @@ class OutController extends Controller
      */
     private function _updateSave() {
         $data = (array) request('data');
-        if ($data['status'] == 3|| $data['status'] == 2) { //审核不过已打款发送梦想消息
+        $info = UserCashOut::find(request('id'));
+        if ($data['status'] != 1) { //审核不过已打款发送梦想消息
             if ($data['status'] == 3) {
                 $message = '你的提现被拒绝了。客服会在短时间内联系你。';
+            }elseif($data['status'] == 4){
+                $message = '亲,你的提现我们已经审批通过,你的梦想基金很快就到账了哦!';
             }else{
 //                已打款  记录提现日志  并且用户的账号梦想币减少
                 $user = UserInfoModel::find($data['user_id']);
@@ -115,7 +119,7 @@ class OutController extends Controller
                         'to_name'=>$user->nickname,
                         'to_amount'=>$data['cash'],
                         'channel'=>'平台内',
-                        'transaction_id'=>date('YmdHis') . mt_rand(1000, 9999),
+                        'transaction_id'=>$info->number,
                         'avatar'=>env('APP_URL').'/base/img/jianhao.png',
                     ];
                     AccountLog::create($arr);

+ 6 - 1
server/app/Http/Controllers/Api/V1/DreamController.php

xqd
@@ -264,8 +264,13 @@ class DreamController extends Controller
         if(empty($c)) $c = 3;
         $n = count($setting) > 0 ? $setting->sort : 0;
         //Todo 支持乘数目公式      pow(x,y)
-//        exp(x)     $number =  N*exp(-a*(pow(t,1/b)))+1
+//        exp(x)     $number =  N*exp(-a*(pow(t,1/b)))+1  180
         $number =round( $n*exp(-$a*(pow($b,1/$c)))+1,2);
+        $test =round( $n*exp(-$a*(pow(180,1/$c)))+1,2);
+        Log::info("发布的时间(分钟):$b");
+        Log::info("支持乘数:$number");
+        Log::info("支持乘数测试(180分钟):$test");
+        Log::info("--------");
         if ($number <= 1) $number = 1;
         $dream = DreamInfoModel::with(['imgs','user'])->find($id);
         if (empty($dream)) return $this->error(ErrorCode::DREAM_NOT_EXIST);

+ 4 - 2
server/app/Http/Controllers/Api/V1/IndexController.php

xqd
@@ -130,12 +130,14 @@ class IndexController extends Controller
         }
         $type = $request->type;
         if ($type == 'trend') {
+//            潮流  发布三天之内的梦想
             $banners = $this->getBanner();
-            $dreams = DreamInfoModel::where('end_time','>',date('Y-m-d H:i:s'))->whereBetween('created_at',[date('Y-m-d H:i:s'),date('Y-m-d H:i:s',time()+3*24*3600)])->orderBy('score','desc')->with('user')->whereNotIn('id', $id_arr1)->limit(100)->paginate(20);
+            $dreams = DreamInfoModel::where('end_time','>',date('Y-m-d H:i:s'))->where('created_at','<',date('Y-m-d H:i:s'))->where('created_at','>',date('Y-m-d H:i:s',time()-3*24*3600))->orderBy('score','desc')->with('user')->paginate(20);
             $this->dreams($dreams);
         } elseif ($type == 'news') {
+//            最新  发布不到一天前的梦想   ->whereNotIn('id', $id_arr2)
             $banners = $this->getBanner();
-            $dreams = DreamInfoModel::where('end_time','>',date('Y-m-d H:i:s'))->whereBetween('created_at',[date('Y-m-d H:i:s'),date('Y-m-d H:i:s',time()+24*3600)])->orderBy('score','desc')->orderBy('created_at','desc')->with('user')->whereNotIn('id', $id_arr2)->paginate(20);
+            $dreams = DreamInfoModel::where('end_time','>',date('Y-m-d H:i:s'))->where('created_at','<',date('Y-m-d H:i:s'))->where('created_at','>',date('Y-m-d H:i:s',time()-1*24*3600))->orderBy('created_at','desc')->with('user')->paginate(20);
             $this->dreams($dreams);
         } else{
 //            热门

+ 4 - 1
server/app/Http/Controllers/Api/V1/MyController.php

xqd
@@ -583,11 +583,14 @@ class MyController extends Controller
 //        $info['to_name'] = $data['account']; //账号
 //        $info['note'] = $data['type'].$data['name'];
 //        $ok = AccountLog::create($info);
+        $transaction_id = date('YmdHis') . mt_rand(1000, 9999);
         $data['user_id'] = $user->id;
         $data['status'] = 1;
+        $data['number'] = $transaction_id;
         $ok = UserCashOut::create($data);
 
-        $message = '你提现的¥'.$data["cash"].'已经到账啦,去实现梦想吧!喵~ ';
+//        $message = '你提现的¥'.$data["cash"].'已经到账啦,去实现梦想吧!喵~ ';
+        $message = '你提现的申请已经提交,我们会第一时间审核哦';
         $info = [
             'user_id' => $user->id,
             'message' => $message,

+ 32 - 0
server/database/migrations/2017_11_06_202218_change_number_to_user_cash_out_table.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class ChangeNumberToUserCashOutTable extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('user_cash_out', function (Blueprint $table) {
+            $table->string('number')->nullable()->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('user_cash_out', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 2 - 2
server/resources/views/admin/account_log/index.blade.php

xqd xqd
@@ -19,7 +19,7 @@
 								
             <th  data-sort="to_type"> 充值类型 </th>
             <th  data-sort="transaction_id"> 交易号 </th>
-            <th  data-sort="to_amount"> 充值金额 </th>
+            <th  data-sort="to_amount"> 充值金额(元) </th>
             <th  data-sort="created_at"> 充值时间 </th>
         						{{--<th width="22%">相关操作</th>--}}
         					</tr>
@@ -30,7 +30,7 @@
 								<tr>
 									<td>{{ $item->to_type }}</td>
 									<td>{{ $item->transaction_id }}</td>
-									<td>{{ $item->to_amount }}</td>
+									<td>{{ $item->to_amount /100}}</td>
 									<td>{{ $item->created_at }}</td>
 									{{--<td>
 										<a href="{{ U('Account_logs/Info/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-primary ">删除</a>

+ 4 - 6
server/resources/views/admin/share1.blade.php

xqd
@@ -294,12 +294,10 @@
                     <p>{{$days}}</p>
                     <p style="font-size: 13px; color: #919191">剩余时间</p>
                 </div>
-                @if( $dream->user_id == $user_id)
-                    <div style="float:right;">
-                        <p style="text-align: right">{{$dream->mark}}</p>
-                        <p style="font-size: 13px;; color: #919191">当前获得梦想分数</p>
-                    </div>
-                @endif
+                <div style="float:right;">
+                    <p style="text-align: right">{{$dream->mark}}</p>
+                    <p style="font-size: 13px;; color: #919191">当前获得梦想分数</p>
+                </div>
             </div>
             <div style="clear:both; height: 50px; padding: 5px 10px;">
                 <div style="text-align: left; float:left;">

+ 2 - 2
server/resources/views/admin/user/cash/out/index.blade.php

xqd xqd
@@ -37,7 +37,7 @@
     						<tr>
 								
             <th class="sorting" data-sort="id"> id </th>
-            <th class="sorting" data-sort="transaction_id"> 交易号 </th>
+            <th class="sorting" data-sort="number"> 交易号 </th>
             <th class="sorting" data-sort="user_id"> 提现用户 </th>
             <th class="sorting" data-sort="bank_id"> 提现银行 </th>
             <th class="sorting" data-sort="bank_id"> 卡号 </th>
@@ -54,7 +54,7 @@
 							@foreach($list as $key => $item)							<tr>
 
 			<td>{{ $item->id }}</td>
-			<td>{{ $item->transaction_id }}</td>
+			<td>{{ $item->number }}</td>
 			<td>{{ !empty($item->user) ? $item->user->nickname : '' }}</td>
 			<td>{{ !empty($item->bank) ? $item->bank->bank_name : '' }}</td>
 			<td>{{ !empty($item->bank) ? $item->bank->bank_number : '' }}</td>