Skip to content

Commit be3397c

Browse files
产品查询,加入id
1 parent 5eec9ad commit be3397c

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

services/Customer.php

-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,6 @@ protected function actionGetLoginSuccessRedirectUrl()
532532
protected function actionLoginSuccessRedirect($urlKey = '')
533533
{
534534
$url = $this->getLoginSuccessRedirectUrl();
535-
536535
if ($url) {
537536
// 这个优先级最高
538537
// 在跳转之前,去掉这个session存储的值。跳转后,这个值必须失效。

services/product/ProductMysqldb.php

+8
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ public function getBySpu($spu, $returnArr = true)
186186
public function coll($filter = '')
187187
{
188188
$query = $this->_productModel->find();
189+
// 对于存在select的查询,自动加上主键值。
190+
if (isset($filter['select']) && is_array($filter['select'])) {
191+
$primaryKey = $this->getPrimaryKey();
192+
if (!in_array($primaryKey, $filter['select'])) {
193+
$filter['select'][] = $primaryKey;
194+
}
195+
}
196+
//var_dump($filter['select']);exit;
189197
$query = Yii::$service->helper->ar->getCollByFilter($query, $filter);
190198

191199
$coll = $query->all();

0 commit comments

Comments
 (0)