gq 7 yıl önce
ebeveyn
işleme
1e3a25c4d5

+ 4 - 2
server/app/Http/Controllers/Admin/Dream/InfoController.php

xqd
@@ -72,15 +72,17 @@ class InfoController extends Controller
             $url[] = array('url'=>U( 'Dream/Info/index'),'title'=>'返回列表');
             return $this->showWarning('请添加图片',$url);
         }
+        $data['created_at'] = date('Y-m-d H:i:s');
+        $data['updated_at'] = date('Y-m-d H:i:s');
         $id = DreamInfoModel::insertGetId($data);
         //        生成二维码
-        $info['transaction_id'] = date('YmdHis') . mt_rand(1000, 9999);
+       /* $info['transaction_id'] = date('YmdHis') . mt_rand(1000, 9999);
         $info['code'] = 'WECHATPAY_' . $info['transaction_id'];
         $code_url = env('APP_URL').'/user/meet?dream_id='.$id;
         $code_path = public_path('qrcodes/'.$info['code'].'.png');
         \QrCode::format('png')->size(500)->generate($code_url,$code_path);
         $code =  env('APP_URL').'/qrcodes/'.$info['code'].'.png';
-        DreamInfoModel::where('id',$id)->update(compact('code'));
+        DreamInfoModel::where('id',$id)->update(compact('code'));*/
         if($id) {
             $arr = [];
             foreach ($pics['url'] as $pic) {

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

xqd
@@ -10,11 +10,13 @@ class InfoController extends Controller
 {
     public function view(Request $request){
         $dream = DreamInfoModel::with('img')->find($request->id);
-        $times = (strtotime($dream->end_time) -strtotime( $dream->created_at));
+        $times = (strtotime($dream->end_time) -time());
         if ($times>=3600*24) {
             $days =floor($times/3600/24)  .'天';
         } elseif($times>3600 && $times< 3600*24){
             $days = floor($times/3600) .'小时';
+        }elseif($times <=0){
+            $days = '已结束';
         }else{
             $days =floor ($times/60) .'分钟';
         }

+ 1 - 0
server/app/Http/Controllers/Api/V1/IndexController.php

xqd
@@ -181,6 +181,7 @@ class IndexController extends Controller
      * @apiErrorExample {json} Error-Response:
      * HTTP/1.1 400 Bad Request
      */
+
     public function search(Request $request)
     {
         $user = $this->getUser();

+ 1 - 2
server/resources/views/admin/share.blade.php

xqd xqd
@@ -17,7 +17,6 @@
     </style>
 </head>
 <body>
-<h4 style="text-align: center; font-weight: normal; width: 100%; border-bottom: 1px solid #DEDEDE; padding-bottom: 15px">分享梦想页</h4>
 <img style="width: 100%; height: 100%;" src="{{!empty($dream->img) ? $dream->img->pic : ''}}
 
 ">
@@ -51,7 +50,7 @@
         <p style="font-size: 13px; color: #919191">我要求的梦想币</p>
     </div>
 </div>
-<div style="padding: 0 10px">
+<div style="padding: 0 10px 20px  10px">
     <div style="background-color:#E6E6E6; width: 100%;">
         <div style="width: {{($dream->get_coin / $dream->coin)}} %; background: #FF6600; height: 5px">
         </div>