Mike il y a 8 ans
Parent
commit
3e29419fbf

+ 1 - 0
miaomiao/www/js/controllers/add.js

xqd
@@ -56,6 +56,7 @@
                    pic:'http://img.taopic.com/uploads/allimg/130103/240435-1301030P33161.jpg',
                    dream:$scope.vm.dream,
                    about:$scope.vm.about,
+                   time:21, //默认21
                    money:$scope.vm.money
                };
                myService.add(data).then(function(result){

+ 1 - 2
miaomiao/www/templates/add/index.html

xqd
@@ -21,8 +21,7 @@
                     <i class="icon ion-plus"></i>
                     添加梦想介绍
                 </a>-->
-                <textarea rows="4" cols="50" placeholder="添加梦想介绍" ng-model="vm.about" style="border: 1px solid #FF4B82">
-</textarea>
+                <textarea rows="4" cols="50" placeholder="添加梦想介绍" ng-model="vm.about" style="border: 1px solid #FF4B82;padding: 10px;"></textarea>
 
             </div>
             <div class="item">上传图片和视频,让别人更好的了解你</div>

+ 7 - 8
server/app/Http/Controllers/Api/V1/MyController.php

xqd xqd xqd
@@ -738,8 +738,8 @@ class MyController extends Controller
     /**
      * @api {post} /api/my/add_dream 发布梦想(addDream)
      * @apiDescription 发布梦想(addDream)
-       * @apiParam {string}  pic   梦想图片 数组
-       * @apiParam {string}  videos   梦想视频
+       * @apiParam {string}  pics   梦想图片 数组
+       * @apiParam {string}  video   梦想视频
        * @apiParam {string}  dream   梦想标题
        * @apiParam {string}  about   梦想介绍
        * @apiParam {int}  money   梦想币
@@ -784,14 +784,13 @@ class MyController extends Controller
             ]
         );
         if($validator->fails()) return $this->validatorError($validator->messages()->all(),ErrorCode::CLIENT_WRONG_PARAMS);
-
+        \Log::info($user);
         $data2 = $user->myCareNum;
         $care_num = count($data2);
-        $key = BaseSettingsModel::where('category','paihang')->first();
-        $a = $key ->key;
-        $b = $key ->value;
+        $setting = BaseSettingsModel::where('category','paihang')->first();
+        $a = $setting ->value;
         $t = 21*3600 / 60;
-        $data = $request->except('_token','pic');
+        $data = $request->except('_token','pics');
         $data['score'] = (log($care_num) + ($a/$t) + $b)*100000000 ;
         $data['created_at'] = date('Y-m-d H:i:s');
         $data['updated_at'] = date('Y-m-d H:i:s');
@@ -802,7 +801,7 @@ class MyController extends Controller
             $data1['user_id'] = $user->id;
             $data1['created_at'] = date('Y-m-d H:i:s');
             $data1['updated_at'] = date('Y-m-d H:i:s');
-            $arr = $request->pic;
+            $arr = $request->pics;
             $videos = $request->videos;
             if (empty($arr) && empty($videos))   return $this->error(ErrorCode::ATTACHMENT_NOT_EXIST);
             $ok = UserDream::create($data1);