File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
app/Http/Controllers/Backend/Api/V2 Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -129,9 +129,12 @@ public function transactionTop(Request $request)
129
129
$ tableOrders = TableConstant::TABLE_ORDERS ;
130
130
$ tableOrderGoods = TableConstant::TABLE_ORDER_GOODS ;
131
131
132
+ $ queryParams = [];
133
+
132
134
$ goodsTypeSql = '' ;
133
135
if ($ goodsType ) {
134
- $ goodsTypeSql = ' and ' . $ tableOrderGoods . ".goods_type=' {$ goodsType }' " ;
136
+ $ goodsTypeSql = ' and ' . $ tableOrderGoods . '.goods_type=? ' ;
137
+ $ queryParams [] = $ goodsType ;
135
138
}
136
139
137
140
$ countSql = <<<SQL
@@ -161,8 +164,8 @@ public function transactionTop(Request $request)
161
164
limit {$ offset }, {$ size };
162
165
SQL ;
163
166
164
- $ count = DB ::selectOne ($ countSql );
165
- $ result = DB ::select ($ sql );
167
+ $ count = DB ::selectOne ($ countSql, $ queryParams );
168
+ $ result = DB ::select ($ sql, $ queryParams );
166
169
167
170
return $ this ->successData ([
168
171
'data ' => $ result ,
You can’t perform that action at this time.
0 commit comments