|
@@ -14,6 +14,7 @@ use App\Models\Reward;
|
14
|
14
|
use App\Models\ProductOrder;
|
15
|
15
|
use App\Models\ServerInfo;
|
16
|
16
|
use App\Models\WechatInfo;
|
|
17
|
+use App\Models\Comment;
|
17
|
18
|
use Illuminate\Http\Request;
|
18
|
19
|
use Illuminate\Support\Facades\Storage;
|
19
|
20
|
use Carbon\Carbon;
|
|
@@ -140,7 +141,20 @@ class CommonController extends Controller
|
140
|
141
|
$order_id = $request->route("order_id");
|
141
|
142
|
$order_type = $request->route("order_type");
|
142
|
143
|
if ($order_id && $order_type) {
|
143
|
|
- return Comment::where("order_id", $order_id)->where("type", $order_type)->paginate(20);
|
|
144
|
+ return Comment::where("order_id", $order_id)->where("order_type", $order_type)->orderBy('id', 'desc')->paginate(20);
|
|
145
|
+ }
|
|
146
|
+ }
|
|
147
|
+
|
|
148
|
+ /**
|
|
149
|
+ * 分页获取订单评论
|
|
150
|
+ * @param Request $request
|
|
151
|
+ * @return mixed
|
|
152
|
+ */
|
|
153
|
+ public function type_comments(Request $request, $order_type)
|
|
154
|
+ {
|
|
155
|
+ $order_type = $request->route("order_type");
|
|
156
|
+ if ($order_type) {
|
|
157
|
+ return Comment::where("order_type", $order_type)->orderBy('id', 'desc')->paginate(20);
|
144
|
158
|
}
|
145
|
159
|
}
|
146
|
160
|
|