all(),[ 'corpid' => 'nullable|string', 'start_date' => 'nullable|date_format:Y-m-d', 'end_date' => 'nullable|date_format:Y-m-d', 'type' => 'nullable|in:1,2' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['corpid'] = $request->input('corpid'); $params['order_id'] = $request->input('order_id'); $params['unionid'] = $request->input('unionid'); $params['pay_status'] = $request->input('pay_status'); $params['order_source'] = $request->input('order_source'); $params['start_date'] = $request->input('start_date'); $params['end_date'] = $request->input('end_date'); $params['user_reg_st'] = $request->input('user_reg_st'); // 用户注册起始时间 $params['user_reg_et'] = $request->input('user_reg_et'); // 用户注册截止时间 $params['appid'] = $request->input('appid'); $params['order_type'] = $request->input('order_type'); // 订单类型 1mp投放订单 2adq投放订单 $params['plat_order_type'] = $request->input('plat_order_type'); // 订单来源 0小程序 1H5 $params['is_ad_user'] = $request->input('is_ad_user'); // 收入来源 0运营 1投放 $params['sys_group_id'] = $request->input('sys_group_id'); $params['account_id'] = $request->input('account_id'); $params['order_pay_type'] = $request->input('order_pay_type'); // 订单支付类型 1小程序虚拟支付 2其他支付 $params['ad_report_action_type'] = $request->input('ad_report_action_type');// 1下单 2付费 0全部 $params['corp_id'] = $request->input('corp_id'); # 获取订单数据统计 $data = OrderService::dataStatSecond($params); return self::returnValue(['data' => $data]); } /** * 订单列表 * */ public function lists(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required|string', 'start_date' => 'nullable|date_format:Y-m-d', 'end_date' => 'nullable|date_format:Y-m-d', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['corpid'] = $request->input('corpid'); $params['order_id'] = $request->input('order_id'); $params['unionid'] = $request->input('unionid'); $params['pay_status'] = $request->input('pay_status'); $params['order_source'] = $request->input('order_source'); $params['start_date'] = $request->input('start_date'); $params['end_date'] = $request->input('end_date'); $params['user_reg_st'] = $request->input('user_reg_st'); // 用户注册起始时间 $params['user_reg_et'] = $request->input('user_reg_et'); // 用户注册截止时间 $params['appid'] = $request->input('appid'); $params['order_type'] = $request->input('order_type'); // 订单类型 1mp投放订单 2adq投放订单 $params['plat_order_type'] = $request->input('plat_order_type'); // 订单来源 0小程序 1H5 $params['is_ad_user'] = $request->input('is_ad_user'); // 收入来源 0运营 1投放 $params['account_id'] = $request->input('account_id'); $params['sys_group_id'] = $request->input('sys_group_id'); $params['order_pay_type'] = $request->input('order_pay_type'); $params['ad_report_action_type'] = $request->input('ad_report_action_type');// 1下单 2付费 0全部 $params['corp_id'] = $request->input('corp_id'); $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); # 获取订单数据统计 list($list, $count) = OrderService::getOrderList($params, $params['corpid'], $page, $pageSize); return self::returnPageValue($list, $count, $pageSize, $page); } public function actionUpload(Request $request) { $validator = \Validator::make($request->all(),[ 'order_id' => 'required' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $orderId = $request->input('order_id'); $orderDataId = $request->input('order_data_id'); $errcode = 0; OrderService::actionUpload($orderId, $orderDataId, $errcode); return self::returnValue([], $errcode); } public function orderExport(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'nullable|string', 'start_date' => 'nullable|date_format:Y-m-d', 'end_date' => 'nullable|date_format:Y-m-d', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['corpid'] = $request->input('corpid'); $params['order_id'] = $request->input('order_id'); $params['order_source'] = $request->input('order_source'); $params['start_date'] = $request->input('start_date'); $params['end_date'] = $request->input('end_date'); $params['appid'] = $request->input('appid'); $params['plat_order_type'] = $request->input('plat_order_type'); // 订单来源 0小程序 1H5 $params['is_ad_user'] = $request->input('is_ad_user'); // 收入来源 0运营 1投放 $params['sys_group_id'] = $request->input('sys_group_id'); $params['account_id'] = $request->input('account_id'); $errcode = 0; OrderService::orderExport($params, $errcode); } // 数据看板订单列表 public function orderList(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'nullable|string', 'start_date' => 'nullable|date_format:Y-m-d', 'end_date' => 'nullable|date_format:Y-m-d', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['corpid'] = $request->input('corpid'); $params['order_id'] = $request->input('order_id'); $params['order_source'] = $request->input('order_source'); $params['start_date'] = $request->input('start_date'); $params['end_date'] = $request->input('end_date'); $params['appid'] = $request->input('appid'); $params['plat_order_type'] = $request->input('plat_order_type'); // 订单来源 0小程序 1H5 $params['is_ad_user'] = $request->input('is_ad_user'); // 收入来源 0运营 1投放 $params['sys_group_id'] = $request->input('sys_group_id'); $params['account_id'] = $request->input('account_id'); $params['order_pay_type'] = $request->input('order_pay_type'); $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); list($list, $count) = OrderService::orderList($params, $page, $pageSize); return self::returnPageValue($list, $count, $pageSize, $page); } public function platformList() { $list = config('platform.base'); $data = []; foreach ($list as $k => $v) { $data[] = [ 'platform_id' => $k, 'platform_title' => $v, ]; } return self::returnValue($data); } public function orderExportOffline(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'nullable|string', 'start_date' => 'nullable|date_format:Y-m-d', 'end_date' => 'nullable|date_format:Y-m-d', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $params['corpid'] = $request->input('corpid'); $params['order_id'] = $request->input('order_id'); $params['order_source'] = $request->input('order_source'); $params['start_date'] = $request->input('start_date'); $params['end_date'] = $request->input('end_date'); $params['appid'] = $request->input('appid'); $params['plat_order_type'] = $request->input('plat_order_type'); // 订单来源 0小程序 1H5 $params['is_ad_user'] = $request->input('is_ad_user'); // 收入来源 0运营 1投放 $params['sys_group_id'] = $request->input('sys_group_id'); $params['account_id'] = $request->input('account_id'); $params['order_pay_type'] = $request->input('order_pay_type'); $errcode = 0; OrderService::orderExportOffline($params, $errcode); return self::returnValue([], $errcode); } public function orderExportList(Request $request) { $page = $request->input('page', 1); $pageSize = $request->input('page_size', 20); $sysGroupId = $request->input('sys_group_id'); list($res, $count) = OrderService::orderExportList($sysGroupId, $page, $pageSize); return self::returnPageValue($res, $count, $pageSize, $page); } # 设置第三方平台订单金额分成比例 public function setShareInProportionConf(Request $request) { $validator = \Validator::make($request->all(),[ 'sys_group_id' => 'required|numeric|in:1,2,3,4,5,6,7,9', 'order_source' => 'required|numeric|in:1,2,3,4,5,6,7,8,9', 'android_percent' => 'required', 'ios_percent' => 'required', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $sysGroupId = $request->input('sys_group_id'); $orderSource = $request->input('order_source'); $androidPercent = $request->input('android_percent'); $iosPercent = $request->input('ios_percent'); $errcode = 0; OrderService::setShareInProportionConf($sysGroupId, $orderSource, $androidPercent, $iosPercent, $errcode); return self::returnValue('', $errcode); } # 获取第三方平台订单金额分成比例 public function getShareInProportionConf(Request $request) { $validator = \Validator::make($request->all(),[ 'sys_group_id' => 'required|numeric', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $sysGroupId = $request->input('sys_group_id'); $data = OrderService::getShareInProportionConf($sysGroupId); return self::returnValue($data); } }