isValid()) return 1010; $fileExt = $file->getClientOriginalExtension(); if ($fileExt != 'xlsx') return 1011; try { // 导入数据 $import = new WXPopulationInfoImport(); Excel::import($import, $file); } catch (\Throwable $e) { EmailQueue::rPush('万象人群包导入失败', $e->getMessage(), ['xiaohua.hou@kuxuan-inc.com'], '聚星'); Log::error('万象人群包导入失败', [ 'msg' => $e->getMessage(), 'trace' => $e->getTraceAsString() ], 'ImportPopulationInfo'); return 1015; } return 0; } /** * 万象人群包列表 * */ public static function populationLists($advertiserId, $orientationId, $orientationName, $page, $pageSize) { list($list, $total) = WXPopulation::getPopulationList($advertiserId, $orientationId, $orientationName, $page, $pageSize); return [$list, $total]; } /** * 万象人群包启用/禁用 * */ public static function changeStatus($populationIds, $enable) { $populationIds = explode(',', $populationIds); $rst = WXPopulation::whereIn('id', $populationIds)->update(['enable'=> $enable]); return $rst ? 0 : 1016; } }