Browse Source

删除运费模板search中的无用字段

antshop
linyaostalker 5 years ago
parent
commit
b0c2940cdf
  1. 13
      backend/modules/shop/models/searchs/ExpressTemplateSearch.php

13
backend/modules/shop/models/searchs/ExpressTemplateSearch.php

@ -26,8 +26,8 @@ class ExpressTemplateSearch extends ExpressTemplate
public function rules()
{
return [
[['id', 'calculation_type', 'basic_price', 'basic_count', 'extra_price', 'extra_count', 'updated_at', 'created_at'], 'integer'],
[['name', 'province', 'city', 'area'], 'safe'],
[['id', 'calculation_type', 'updated_at', 'created_at'], 'integer'],
[['name'], 'safe'],
['created_at_range','safe'],
];
}
@ -122,18 +122,11 @@ class ExpressTemplateSearch extends ExpressTemplate
$query->andFilterWhere([
'id' => $this->id,
'calculation_type' => $this->calculation_type,
'basic_price' => $this->basic_price,
'basic_count' => $this->basic_count,
'extra_price' => $this->extra_price,
'extra_count' => $this->extra_count,
'updated_at' => $this->updated_at,
'created_at' => $this->created_at,
]);
$query->andFilterWhere(['like', 'name', $this->name])
->andFilterWhere(['like', 'province', $this->province])
->andFilterWhere(['like', 'city', $this->city])
->andFilterWhere(['like', 'area', $this->area]);
$query->andFilterWhere(['like', 'name', $this->name]);
if ($this->created_at_range) {
$arr = explode(' ~ ', $this->created_at_range);
$start = strtotime($arr[0]);

Loading…
Cancel
Save