Commit e50189d2 authored by 孙磊's avatar 孙磊

yh

Signed-off-by: 孙磊's avatarsunlei <sunlei@romens.cn>
parent 8c11d99b
......@@ -299,11 +299,16 @@ class ShopBranch extends BaseModel
if (isset($params['RECIVER_REGION'])) {
$query->andfilterWhere(['like', 'sb.RECIVER_REGION', $params['RECIVER_REGION']]);
}
//门店guid 权限
if(isset($params['where_branch']) && !empty($params['where_branch'])){
$branch_arr = explode(',',$params['where_branch']);
$query->andfilterWhere(['sb.GUID'=>$branch_arr]);
}
return new ActiveDataProvider([
'query' => $query->asArray(),
'pagination' => [
'pageSize' => 10
'pageSize' => PAGE_SIZE
],
'sort' => [
'attributes' => [
......@@ -326,7 +331,19 @@ class ShopBranch extends BaseModel
->where(['GUID'=>$GUID])
->asArray()
->one();
return $query;
}
//获取门店(权限下的)
public function GetBranch($GUID,$SUPPROVINCE_GUID)
{
$query = static::find()
->select('GUID,SUPPROVINCE_GUID')
->where(['GUID'=>$GUID])
->andWhere(['like', 'SUPPROVINCE_GUID', $SUPPROVINCE_GUID])
->asArray()
->one();
return $query;
}
/**
......
......@@ -93,13 +93,19 @@ class ShopCityDistributionRegion extends BaseModel
->where(['cs.SETTING_TYPE' => 2]);
//门店名称或编码
if (isset($params) && !empty($params)) {
if (isset($params['CODE']) && !empty($params['CODE'])) {
$query->andfilterWhere(['or', ['like','sb.CODE', $params['CODE']],['like', 'sb.NAME', $params['CODE']]]);
}
//当前权限允许的门店
if (isset($params['BRANCH_GUID']) && !empty($params['BRANCH_GUID'])) {
$query->andFilterWhere(['or',['=','ifnull(sb.SUPPROVINCE_GUID,cs.BRANCH_GUID)',$params['BRANCH_GUID']],['=',"ifnull(sb.PARENT_GUID,'')",$params['BRANCH_GUID']]]);
//$query->andWhere(['not', ['sg.GUID' => '']]);
$query->andWhere(['!=','sg.GUID','']);
}
//批量修改 条件
if(isset($guid) && !empty($guid)){
$query->andFilterWhere(['=','cs.BRANCH_GUID',$guid]);
$query->andFilterWhere(['!=','sg.GUID','']);
$query->andWhere(['!=','sg.GUID','']);
}
return new ActiveDataProvider([
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment