_uniacid); if($permissson->pAuth()) { $modelMenu = [ "title" => '商品服务', "desc" => '', "show" => true, "row" => 4, "list" => [ [ "title" => "我的收入", "icon" => "icontixianguanli", "link" => "/shop/pages/partner/income", "linkType" => 4 ], [ "title" => "订单管理", "icon" => "iconwodedingdan", "link" => "/shop/pages/order/list?target=staff", "linkType" => 4 ], [ "title" => "退款管理", "icon" => "iconwodeshouhou", "link" => "/shop/pages/refund/list?target=staff", "linkType" => 4 ], [ "title" => "推荐商品", "icon" => "icontuijianshangpin", "link" => "/shop/pages/staff/goods/push", "linkType" => 4 ], [ "title" => "卡券管理", "icon" => "iconwodekaquan", "link" => "/shop/pages/staff/coupon/list", "linkType" => 4 ] ] ]; return [$modelMenu]; } return []; } /** * 名片展示页获取其他模块数据 * * @param $params * @return array * @author shuixian * @DataTime: 2019/12/24 14:24 */ public function onCardInfo($params) { //获取推荐商品 By.jingshuixian $modelExtension = new CardExtension(); $goods_list = $modelExtension->cardExtensionList($params['staff_id'], $this->_uniacid); $collage_model = new IndexShopCollage(); foreach ($goods_list as $key => $val) { $goods_list[$key]['is_collage'] = 0; $count = $collage_model->getCollage(['goods_id' => $val['id'], 'uniacid' => $this->_uniacid, 'status' => 1]); if (!empty($count)) $goods_list[$key]['is_collage'] = 1; } return ['goods_list'=>$goods_list]; } /** * 客户获取列表查询 * * @param $data * @return array * @author shuixian * @DataTime: 2019/12/26 10:30 */ public function onStaffCustomerList($data) { // 商城订单 $orderCount = RadarOrder::where( [ [ 'pay_status', '=', 1 ], [ 'order_status', '<>', 1 ], [ 'user_id', '=', $data[ 'uid' ] ], [ 'to_uid', '=', $data[ 'to_uid' ]], [ 'refund_status', '=', 0 ] ] ) ->count(); $returnData[ 'count' ] = $orderCount; $returnData[ 'title' ] = "订单"; return [$returnData]; } /** * @param $data * @功能说明:处理一下数据 主要是权限方面的 * @author chenniang * @DataTime: 2020-12-16 16:21 */ public function onDiyModuleMenuShop($data){ if(!empty($data['data']['list'])){ foreach ($data['data']['list'] as $v){ if($v['icon']!='icontemplate'||$data['shop_auth']==true){ $arr[] = $v; } } $data['data']['list'] = $arr; } return $data; } /** * 监听用户中心模块 * * @return array * @author shuixian * @DataTime: 2019/12/18 14:04 */ public function onAddUcenterCompoent(){ $this->getUserId(); $user = longbingGetUserInfo($this->getUserId() , $this->_uniacid); $last_staff_id = !empty($user['last_staff_id'])?$user['last_staff_id']:0; $moduleMenuShopOrder = <<_uniacid); $bargain_auth = $bargain_p->pAuth(); $bargain = $bargain_auth==true?', { "title": "我的砍价", "icon": "iconkanjiajilu", "link": { "type": 2, "url": "/shop/pages/bargain/record" } }':''; $moduleMenuShop = <<_uniacid); $compoentList = [] ; if($permission->pAuth()){ $compoentList = [ json_decode($moduleMenuShopOrder, true), json_decode($moduleMenuShop, true) ] ; } return $compoentList ; } /** * 监听代理管理端授权小程序事件 * * @param $data * @return array * @author shuixian * @DataTime: 2019/12/27 17:33 */ public function onAgentAppAuthEdit($config){ $returnArr = [] ; $permission = new PermissionShop(0); $shop_switch = [] ; if($permission->sAuth() && $permission->infoConfig['auth_platform'] ) { $shop_switch['formType'] = 'radio'; $shop_switch['name'] = 'shop_switch'; $shop_switch['value'] = $config ? $config[ $shop_switch['name'] ] : 0; $shop_switch['title'] = $permission->info['title']; $returnArr[] = $shop_switch; } $pay_shop = [] ; if($permission->sAuth() && $permission->infoConfig['auth_platform'] ) { $pay_shop['formType'] = 'radio'; $pay_shop['name'] = 'pay_shop'; $pay_shop['value'] = $config ? $config[ $pay_shop['name'] ] : 0; $pay_shop['title'] = $permission->info['title'].'支付'; $returnArr[] = $pay_shop; } return $returnArr ; } }