Commit 238cac5c authored by 孙磊's avatar 孙磊

方法名规范化

Signed-off-by: 孙磊's avatarsunlei <sunlei@romens.cn>
parent c6d5dc7a
......@@ -59,7 +59,6 @@ class BranchController extends BaseController
$rbac = new ShopRbacUser();
$userGuid = Yii::$app->user->identity->GUID;
$userinfo = $rbac->getRbacUserInfo($userGuid);
// print_r($userinfo);die();
$where_branch = '';
//是否是 分公司管理员 是的话只显示所管理门店的数据
if ($userinfo['ROLE_ID'] == USER_ROLE_REGION_ADMIN) {
......@@ -78,7 +77,7 @@ class BranchController extends BaseController
if ($model->validate()) {
//所有输入数据都有效 all inputs are valid
$info = $model->BranchInfo($params);
$info = $model->branchInfo($params);
if (!$list = $info->getModels()) {
throw new BadRequestHttpException('未找到符合的门店列表信息');
}
......@@ -116,16 +115,16 @@ class BranchController extends BaseController
if ($model->validate()) {
//所有输入数据都有效 all inputs are valid
$info = $model->BranchDetail($params['GUID']);
$info = $model->branchDetail($params['GUID']);
if (!$list = $info->getModels()) {
throw new BadRequestHttpException('未找到符合的门店列表信息');
}
//获取门店服务类目关系信息
$branchServiceRelation = $branchService->BranchSeviceRelation($params['GUID']);
$branchServiceRelation = $branchService->branchSeviceRelation($params['GUID']);
//获取门店服务类目名称
if ($branchServiceRelation) {
foreach ($branchServiceRelation as $k => $v) {
$branchSType = $branchServiceType->BranchServiceInfo('', '', $v['SERVICE_TYPE_GUID']);
$branchSType = $branchServiceType->branchServiceInfo('', '', $v['SERVICE_TYPE_GUID']);
$branchSerType = $branchSType->getModels();
//获取服务类目信息
if ($branchSerType) {
......@@ -211,7 +210,7 @@ class BranchController extends BaseController
if (isset($param['BRANCH_SERVICE_TYPE']) && !empty($param['BRANCH_SERVICE_TYPE'])) {
$ShopBranchService->scenario = 'create'; //创建的场景
//删除门店原有服务类目
$ShopBranchService->BranchServiceDel($branch_guid);
$ShopBranchService->branchServiceDel($branch_guid);
$BST = $param['BRANCH_SERVICE_TYPE'];
//判断门店服务类目类型
if (is_string($BST)) {
......@@ -251,7 +250,6 @@ class BranchController extends BaseController
$model = new $this->modelClass();
$model->scenario = 'create'; //创建的场景
$other_param = array(
//'GUID'=>Func::create_guid(),
'GUID' => $branch_guid,
'ORG_GUID' => Yii::$app->user->identity->ORG_GUID,
'UPDATE_TIME' => date('Y-m-d H:i:s', time()),
......@@ -290,7 +288,7 @@ class BranchController extends BaseController
public function actionBranchServices()
{
$model = new BranchServiceType();
$info = $model->BranchServiceInfoAll();
$info = $model->branchServiceInfoAll();
if (!$info) {
throw new BadRequestHttpException('未找到符合的门店服务类目信息');
}
......@@ -315,7 +313,7 @@ class BranchController extends BaseController
public function actionBranchTransportType()
{
$model = new ShopTransportType;
$info = $model->BranchTransportInfo();
$info = $model->branchTransportInfo();
if (!$info) {
throw new BadRequestHttpException('未找到符合的门店门店配送方式');
}
......@@ -499,7 +497,7 @@ class BranchController extends BaseController
if (isset($BRANCH_SERVICE_TYPE) && !empty($BRANCH_SERVICE_TYPE)) {
$ShopBranchService->scenario = 'create'; //创建的场景
//删除门店原有服务类目
$ShopBranchService->BranchServiceDel($branch_guid);
$ShopBranchService->branchServiceDel($branch_guid);
//判断门店服务类目类型
if (is_string($BRANCH_SERVICE_TYPE)) {
$BST_arr = explode(',', $BRANCH_SERVICE_TYPE);
......@@ -791,7 +789,7 @@ class BranchController extends BaseController
$string = substr($string, 0, strlen($string) - 1);
$_branchModel->TRANSPORT_TYPE = (string) $string;
$_servicModel = clone $servicModel;
$_servicModel->BranchServiceDel($_branchModel->GUID);
$_servicModel->branchServiceDel($_branchModel->GUID);
$serviceCode = explode(',', $_branchModel->SERVICE_TYPE_CODE);
$serviceArr = [];
foreach ($serviceCode as $servValue) {
......@@ -1024,7 +1022,7 @@ class BranchController extends BaseController
$model = new $this->modelClass();
$guid = Yii::$app->request->getQueryParam('guid');
$info = $model->BranchDetail($guid);
$info = $model->branchDetail($guid);
if (!$info->getModels()) {
throw new BadRequestHttpException('未找到符合的DC信息');
}
......
......@@ -49,7 +49,7 @@ class BranchServiceTypeController extends BaseController
//所有输入数据都有效 all inputs are valid
$code = $model->CODE;
$name = $model->NAME;
$info = $model->BranchServiceInfo($code, $name);
$info = $model->branchServiceInfo($code, $name);
if (!$info->getModels()) {
throw new BadRequestHttpException('未找到符合的门店服务类目信息');
}
......@@ -88,7 +88,7 @@ class BranchServiceTypeController extends BaseController
if ($model->validate()) {
//所有输入数据都有效 all inputs are valid
$code = $model->CODE;
$info = $model->BranchServiceInfo($code, '');
$info = $model->branchServiceInfo($code, '');
if (!$info->getModels()) {
throw new BadRequestHttpException('未找到符合的门店服务类目信息');
}
......@@ -328,7 +328,7 @@ class BranchServiceTypeController extends BaseController
throw new HttpException(422, json_encode($model->errors));
}
$list = $model->BranchServiceExport($params);
$list = $model->branchServiceExport($params);
if (!$list) {
throw new BadRequestHttpException('未找到符合条件的数据');
}
......
......@@ -383,7 +383,7 @@ class ImportGoodsInfoController extends BaseController
$value[5] = preg_replace("/,/", ",", $value[5]);
$transportType = explode(',', $value[5]);
//获取配送方式信息
$getTransportTypeInfo = $transportModel->BranchTransportInfo($transportType);
$getTransportTypeInfo = $transportModel->branchTransportInfo($transportType);
if ($getTransportTypeInfo) {
$transportGuid = array_column($getTransportTypeInfo, 'GUID');
$transportGuid_str = implode(',', $transportGuid);
......@@ -734,7 +734,7 @@ class ImportGoodsInfoController extends BaseController
$value[3] = preg_replace("/,/", ",", $value[3]);
$transportType = explode(',', $value[3]);
//获取配送方式信息
$getTransportTypeInfo = $transportModel->BranchTransportInfo($transportType);
$getTransportTypeInfo = $transportModel->branchTransportInfo($transportType);
if ($getTransportTypeInfo) {
$transportGuid = array_column($getTransportTypeInfo, 'GUID');
$transportGuid_str = implode(',', $transportGuid);
......
......@@ -33,7 +33,7 @@ class UserComplainController extends BaseController
if ($model->validate()) {
//所有输入数据都有效 all inputs are valid
$phone = $model->TS_PHONE;
$info = $model->UserComplainInfo($phone);
$info = $model->userComplainInfo($phone);
if (!$info->getModels()) {
throw new BadRequestHttpException('未找到符合的留言信息');
}
......
......@@ -36,7 +36,7 @@ class UserDepartmentController extends BaseController
//所有输入数据都有效 all inputs are valid
$code = $model->CODE;
$name = $model->NAME;
$info = $model->DepartmentInfo($code, $name);
$info = $model->departmentInfo($code, $name);
if (!$info->getModels()) {
throw new BadRequestHttpException('未找到符合的部门信息');
}
......
......@@ -205,8 +205,8 @@ class TransportInitialPriceController extends BaseController
// if ($userinfo['ROLE_ID'] == USER_ROLE_REGION_ADMIN) {
// //如果是省级,查询出该门店是否是该省级下的
// $branchModel = new ShopBranch();
// $isbrancharr = $branchModel->GetBranch($CS_BRANCH_GUID, $userinfo['BRANCH_GUID']);
// // $isbrancharr = $branchModel->GetBranch(003, 003);
// $isbrancharr = $branchModel->getBranch($CS_BRANCH_GUID, $userinfo['BRANCH_GUID']);
// // $isbrancharr = $branchModel->getBranch(003, 003);
// if (!$isbrancharr) {
// continue;
// }
......
......@@ -61,7 +61,7 @@ class BranchServiceType extends BaseModel
];
}
//门店-门店服务类目信息
public function BranchServiceInfo($code, $name, $guid = '')
public function branchServiceInfo($code, $name, $guid = '')
{
$query = static::find()->select('GUID,NAME,CODE,THEME_COLOR,DESCRIPTION,CREATE_TIME');
......@@ -87,7 +87,7 @@ class BranchServiceType extends BaseModel
);
}
//门店-门店服务类目信息 全部
public function BranchServiceInfoAll()
public function branchServiceInfoAll()
{
$query = static::find()->select('GUID,NAME,CODE,THEME_COLOR,DESCRIPTION,CREATE_TIME')
->all();
......@@ -95,7 +95,7 @@ class BranchServiceType extends BaseModel
return $query;
}
//门店服务类目导出
public function BranchServiceExport($params)
public function branchServiceExport($params)
{
$query = static::find()->select('GUID,NAME,CODE,THEME_COLOR,DESCRIPTION,CREATE_TIME');
......
......@@ -276,7 +276,7 @@ class ShopBranch extends BaseModel
* @params array $params 查询参数数组
* @return array|null 返回查询结果
*/
public function BranchInfo($params)
public function branchInfo($params)
{
$query = static::find()->alias('sb')
->select("sb.GUID,sb.NAME,sb.CONTACT_NAME,sb.PARENT_GUID,sb.CODE,sb.ADDRESS,sb.PHONE,sb.LAT,
......@@ -349,7 +349,7 @@ class ShopBranch extends BaseModel
* @params array $params 查询参数数组
* @return array|null 返回查询结果
*/
public function BranchDetail($GUID)
public function branchDetail($GUID)
{
$query = static::find()
->select('GUID,NAME,CODE,LICENCE_IMAGE_PATH,RECIVER_PROVINCE,RECIVER_CITY,RECIVER_REGION,ADDRESS,PARENT_GUID,
......@@ -363,7 +363,7 @@ class ShopBranch extends BaseModel
]);
}
//获取门店(权限下的)
public function GetBranch($GUID, $SUPPROVINCE_GUID)
public function getBranch($GUID, $SUPPROVINCE_GUID)
{
$query = static::find()
->select('GUID,SUPPROVINCE_GUID')
......
......@@ -53,13 +53,13 @@ class ShopBranchService extends BaseModel
];
}
//删除门店原有服务类目
public function BranchServiceDel($b_guid)
public function branchServiceDel($b_guid)
{
$branchService = static::deleteAll(['BRANCH_GUID' => $b_guid]);
return $branchService;
}
//获取门店服务类目关系
public function BranchSeviceRelation($b_guid)
public function branchSeviceRelation($b_guid)
{
$branchService = static::find()
->select('GUID,BRANCH_GUID,SERVICE_TYPE_GUID')
......
......@@ -77,7 +77,7 @@ class UserComplain extends BaseModel
];
}
//用户留言信息
public function UserComplainInfo($phone)
public function userComplainInfo($phone)
{
$query = static::find()
->from('shop_user_complain suc')
......@@ -90,7 +90,7 @@ class UserComplain extends BaseModel
[
'query' => $query->asArray(),
'pagination' => [
'pageSize' => 15,
'pageSize' => PAGE_SIZE,
]
]
);
......
......@@ -57,11 +57,9 @@ class UserDepartment extends BaseModel
];
}
//用户-部门信息
public function DepartmentInfo($code, $name)
public function departmentInfo($code, $name)
{
//$org_guid = 2;
$query = static::find()->select('GUID,NAME,CODE,COMPANY,SUB_COMPANY,UPDATE_TIME');
//->where(['ORG_GUID' => $org_guid]);
if (isset($name) && !empty($name)) {
$query->andWhere(['like', 'NAME', $name]);
......@@ -74,7 +72,7 @@ class UserDepartment extends BaseModel
[
'query' => $query->asArray(),
'pagination' => [
'pageSize' => 15,
'pageSize' => PAGE_SIZE,
]
]
);
......
......@@ -72,7 +72,7 @@ class ShopTransportType extends BaseModel
];
}
//门店-配送方式信息
public function BranchTransportInfo($name = '')
public function branchTransportInfo($name = '')
{
return $query = static::find()
->select('GUID,NAME')
......
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