市场部隐藏商户查看权限

master
chenzhi 3 years ago
parent a331d874a9
commit 903c3abba0

@ -3286,9 +3286,9 @@ function getCpCompanySelect($type = 1){
* @return mixed
*/
function getMerchantList($type = 1){
if(A('Market','Event')->getConfig('isMarket')) return [];
$data = M("payment_merchant","tab_")->field("id,name,ways")->select();
return $data;
}
@ -3299,9 +3299,9 @@ function getMerchantList($type = 1){
* @return mixed
*/
function getMerchantName($id = 1){
if(A('Market','Event')->getConfig('isMarket')) return '--';
$data = M("payment_merchant","tab_")->field("name")->where(['id'=>$id])->find();
return $data['name']?$data['name']:'无';
}

@ -894,19 +894,21 @@ class FinancePromoteController extends AdminController
$marketAdmins = getAdminUsernameList($marketAdminIds);
$adminDepartments = getAdminDepartmentList($marketAdminIds);
}
$merchant_data = M("payment_merchant","tab_")
->field("id,name")
->where("1=1")
->select();
$handle_merchant = [];
foreach ($merchant_data as $key => $value) {
$handle_merchant[$value['id']] = $value['name'];
$isMarketAdmin = A('Market','Event')->getConfig('isMarket');
if(!$isMarketAdmin){
$merchant_data = M("payment_merchant","tab_")
->field("id,name")
->where("1=1")
->select();
$handle_merchant = [];
foreach ($merchant_data as $key => $value) {
$handle_merchant[$value['id']] = $value['name'];
}
}
foreach($data as $key => $value) {
$data[$key]['merchant_name'] = $handle_merchant[$value['merchant_id']];
$data[$key]['merchant_name'] = $isMarketAdmin ? "--" : $handle_merchant[$value['merchant_id']];
$data[$key]['pay_way'] = getPayType($value['pay_way']);
$data[$key]['game_name'] =clearGameNameType($data[$key]['game_name']);
$data[$key]['sdk_version'] =getGameTypeName($data[$key]['sdk_version']);

@ -149,6 +149,7 @@ class SpendController extends ThinkController
$this->assign('commonset', M('Kuaijieicon')->where(['url' => 'Spend/lists', 'status' => 1])->find());
$data = D(self::model_name)->lists($_GET["p"], $map, $order);
// dd($data);
if (!empty($data['data'])) {
$adminIds = array_column($data['data'], 'market_admin_id');
$adminUsernameList = getAdminUsernameList($adminIds);

Loading…
Cancel
Save