employee->root_id], ['end_at', '>', date('Y-m-d'). ' 00:00:00'] ]; $companybossopened = CompanyBossOpen::where($condition)->find(); $state = $companybossopened?1:0; if($state == 0){ $way = 'free'; if($way == 'free'){ $root_id = request()->employee->root_id; View::assign('root_id', $root_id); View::assign('freetime', 30); return View::fetch('openning_free'); }else{ return View::fetch('openning'); } }else{ // 获取卡片数据 $this->card(); // 获取线型图数据 $this->line(); //$notice_status = model('company')->where('cmid', session('company', '', 'live'))->value('notice_status'); View::assign('notice_status', 1); $content_status = 0; //$content = model('config')->where('field', 'companynotice')->value('content'); //if (!empty($content)) { // $state = json_decode($content, true); // $content_status = $state['status']; //} View::assign('content_status', 0); return View::fetch('index'); } } /** * 获取卡片数据 */ private function card() { // 打赏数据 //$gift = model('giftLog') // ->field('IFNULL(sum(money),0) money, count(id) num') // ->where(['cmid' => session('company', '', 'live'), 'status' => 1]) // ->find(); $gift = ['money' =>10, 'num'=> 10]; View::assign('gift', $gift); // 收订数据 //$order = model('order') // ->field('IFNULL(sum(money),0) money, count(id) num') // ->where(['cmid' => session('company', '', 'live'), 'status' => 1]) // ->find(); $order = ['money' =>10, 'num'=> 10]; View::assign('order', $order); // 裂变余额与裂变次数 //$money = model('fission')->where('cmid', session('company', '', 'live'))->value('money'); //$shareNum = model('shareLog')->where(['cmid' => session('company', '', 'live')])->count(); $money = 1000; $shareNum = 200; View::assign('money', $money); View::assign('shareNum', $shareNum); // 账户到期时间及天数 //$end = model('company')->where('cmid', session('company', '', 'live'))->value('end_date'); //$day = floor((strtotime($end) - time() + 86400) / 86400); $end = '2023-12-31'; $day = 365; View::assign('date', $end); View::assign('day', $day); // 账户余额获取 //$yue = model('fission')->where('cmid', session('company', '', 'live'))->value('yue'); $yue = 120000; View::assign('yue', $yue); } /** * 线型图数据 */ private function line() { // 设置日期(月) $thisMonth = date('n'); $m1 = $m2 = []; $m = 1; while ($m <= 12) { $ms = $m; $m > $thisMonth ? $m2[] = $ms : $m1[] = $ms; $m++; } $month = array_merge($m2, $m1); // 年获取 // 1)这个月的最后一天 $lastDay = date('Y-m-d 23:59:59', strtotime('last day of this month')); $lastTime = strtotime($lastDay); // 2)上一年下个月的第一天 $firstDay = date('Y-m-d 00:00:00', strtotime('first day of +1 month -1 year')); $firstTime = strtotime($firstDay); // x轴数据获取 // 1)分享量 //$share = model('shareLog') // ->where(['cmid' => session('company', '', 'live'), 'addtime' => ['between', [$firstTime, $lastTime]]]) // ->group('m') // ->column("FROM_UNIXTIME(addtime,'%c') m, count(id) num"); // 2)访问量 //$login = WsLoginStatics::where(['cmid' => session('company', '', 'live'), 'first_login_time' => ['between', [$firstDay, $lastDay]]]) // ->group('m') // ->column("DATE_FORMAT(first_login_time,'%c') m, count(id) num"); // 3)订单量 //$order = model('order') // ->where(['cmid' => session('company', '', 'live'), 'addtime' => ['between', [$firstDay, $lastDay]], 'status' => 1]) // ->group('m') // ->column("DATE_FORMAT(addtime,'%c') m, count(id) num"); // 数据整理 //$shareArr = $loginArr = $orderArr = []; //foreach ($month as &$m) { // $shareArr[] = isset($share[$m]) ? $share[$m] : 0; // //$loginArr[] = isset($login[$m]) ? $login[$m] : 0; // $orderArr[] = isset($order[$m]) ? $order[$m] : 0; // $m .= '月'; //} View::assign('shareArr', json_encode([])); View::assign('loginArr', json_encode([])); View::assign('orderArr', json_encode([])); View::assign('month', json_encode([])); } ////////////////////// public function boss_openning($root_id){ $company = Company::where(['root_id'=>$root_id])->find(); if(!$company){ return false; } $freetime = 30; $companybossopen = CompanyBossOpen::where(['root_id'=>$root_id])->find(); if($companybossopen && $companybossopen->end_at < date('Y-m-d'). ' 00:00:00'){ $updatedata = [ 'end_at' => date('Y-m-d',strtotime('+'.$freetime.' day')), ]; $companybossopen->save($updatedata); }else{ //$productType = 'boss_live'; $way = 'free'; ///记录免费订单 $insertdata = [ 'company_name' => $company->company_name, 'company_id' => $company->id, 'root_id' => $root_id, 'unionid' => unionidgen(hanzi2pinyin($company->company_name),16), 'username' => hanzi2pinyin($company->company_name), 'way' => $way, 'start_at' => date('Y-m-d',time()), 'end_at' => date('Y-m-d',strtotime('+'.$freetime.' day')), 'remark' => '' ]; (new CompanyBossOpen())->insert($insertdata); } //同步分平台账号 $datastr = Unionaccount::syncaccount($company->id); $data = json_decode($datastr,true); if($data['code'] == 0 || $data['code'] == 2){ return json(['code' => 0, 'msg' =>'成功开通Boss直播'.$freetime.'天免费期。']); }else{ return json(['code' => 2, 'msg' =>$data['msg']]); } } //////////////// private function getcmucode(){ $request = request(); $root_id = $request->employee->root_id; $companybossopen = CompanyBossOpen::where(['root_id'=>$root_id])->find(); $cmunionid = $companybossopen->unionid; return $cmunionid; } public function build(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/index?page='.$page.'&limit=10'; if($request->param('title')){ $title = $request->param('title'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/index?page='.$page.'&limit=10&title='.$title; } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function goods(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function goods_add(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $picture = ''; $rs = $this->ossUploadBosslive('picture', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']); if ($rs['code'] === 0) { if (!empty($rs['data']['picture'])) { $picture = $rs['data']['picture']; } } $title = $request->param('title'); $shop_price = $request->param('shop_price'); $live_price = $request->param('live_price'); $price = $request->param('price'); $stock = $request->param('stock'); $describe = $request->param('describe'); $details = $request->param('details'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/add?'; $url .= 'title='.$title; $url .= '&shop_price='.$shop_price; $url .= '&live_price='.$live_price; $url .= '&price='.$price; $url .= '&stock='.$stock; $url .= '&picture='.$picture; $url .= '&describe='.$describe; $url .= '&details='.$details; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function course_setting(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/setting'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataraw = json_decode($data, true); View::assign('company', $dataraw['data']['company']); View::assign('fission', $dataraw['data']['fission']); View::assign('teacherNum', $dataraw['data']['teacherNum']); return View::fetch(); } } public function course_wxqrcode(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/wxqrcode_cm_data'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataraw = json_decode($data, true); View::assign('company', $dataraw['company']); return View::fetch(); } $official_account_qrcode = ''; $rs = $this->ossUploadBosslive('official_account_qrcode', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']); if ($rs['code'] === 0) { if (!empty($rs['data']['official_account_qrcode'])) { $official_account_qrcode = $rs['data']['official_account_qrcode']; } } $subscribe = $request->param('subscribe'); $oa_qrcode_url = $official_account_qrcode; $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/wxqrcode?subscribe='.$subscribe.'&official_account_qrcode='.$oa_qrcode_url; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function course_slogan(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/slogan_company'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataraw = json_decode($data, true); View::assign('company', $dataraw['company']); return View::fetch(); } $slogan_state = $request->param('slogan_state'); $slogan = $request->param('slogan'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/slogan?slogan_state='.$slogan_state.'&slogan='.$slogan; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function course_apilinkpushQr(){ $request = request(); $cid = $request->param('cid'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/apilinkpushQr?cid='.$cid; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); //$url = json_decode($data,true); // 返回数据 return $data; } public function keyword_index(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/index?page='.$page.'&limit=10'; if($request->param('name')){ $url .= '&name='.$request->param('name'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function keyword_add(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $value = $request->param('value'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/add?value='.$value; if($request->param('replace')){ $url .= '&replace='.$request->param('replace'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function keyword_edit(){ $request = request(); $id = $request->param('id'); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/edit_data?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataraw = json_decode($data, true); View::assign('data', $dataraw['data']); return View::fetch(); } $value = $request->param('value'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/edit?id='.$id.'&value='.$value; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function keyword_del(){ $request = request(); $id = $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/del?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function present_index(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/index'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataraw = json_decode($data, true); View::assign('data', $dataraw['data']); View::assign('show', $dataraw['show']); return View::fetch(); } } public function present_state(){ $request = request(); $state = $request->param('state'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/state?state='.$state; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function present_show(){ $request = request(); $id = $request->param('id'); $state = $request->param('state'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/show?state='.$state.'&id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function present_save(){ $request = request(); $name = $request->param('name'); $price = $request->param('price'); $num = $request->param('num'); $show = $request->param('show'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/save?name='.$name; $url .= '&price='.$price; $url .= '&num='.$num; $url .= '&show='.$show; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function present_delete(){ $request = request(); $id = $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/delete?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function teacher_index(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/index?page='.$page.'&limit=10'; if($request->param('name') && !empty($request->param('name'))){ $url .= '&name='.$request->param('name'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function teacher_add(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $name = $request->param('name'); $phone = $request->param('phone'); $vx = $request->param('vx'); //$headimg = $request->param('headimg'); $desc = $request->param('desc'); $headimg = ''; $rs = $this->ossUploadBosslive('headimg', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']); if ($rs['code'] === 0) { if (!empty($rs['data']['headimg'])) { $headimg = $rs['data']['headimg']; } } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/add?'; $url .= 'name='.$name; $url .= '&phone='.$phone; $url .= '&vx='.$vx; $url .= '&headimg='.$headimg; $url .= '&desc='.$desc; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function teacher_edit(){ $request = request(); $id = $request->param('id'); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/teacher_train?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataraw = json_decode($data, true); View::assign('data', $dataraw['data']); return View::fetch(); } $name = $request->param('name'); $desc = $request->param('desc'); $vx = $request->param('vx'); $phone = $request->param('phone'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/edit?id='.$id.'&name='.$name; $url .= '&desc='.$desc; $url .= '&vx='.$vx; $url .= '&phone='.$phone; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function teacher_del(){ $request = request(); $id = $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/del?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function white_list_index(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function white_list_qrcode(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/qrcode'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataraw = json_decode($data, true); View::assign('qrcode', $dataraw['qrcode']); View::assign('open', $dataraw['open']); View::assign('contacts_qrcode', $dataraw['contacts_qrcode']); return View::fetch(); } } public function white_list_state(){ $request = request(); $state = $request->param('state'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/state?state='.$state; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function white_list_join(){ $request = request(); $id = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/join?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function white_list_del(){ $request = request(); $id = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/del?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function redbag(){ // $fission = model('fission')->where('cmid', session('company', '', 'live'))->find(); // $this->assign('money', round($fission->money-$fission->freeze, 2)); // return $this->fetch(); $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/redbag_fission_num'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data,true); $money = $dataarr['num']; View::assign('money', $money); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function answer(){ $request = request(); if (!$request->isAjax()) { //$url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/redbag_fission_num'; //$cmunionid = $this->getcmucode(); //$data = curlparam($url,$cmunionid); //$dataarr = json_decode($data,true); // //$money = $dataarr['num']; //View::assign('money', $money); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/answer/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function answer_add(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $title = $request->param('title'); $like = $request->param('like'); $valueArr = $request->param('value'); $value = implode(',', $valueArr); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/answer/add?title='.$title; $url .= '&like='.$like; $url .= '&value='.$value; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function answer_log(){ $request = request(); if (!$request->isAjax()) { $anid = $request->param('anid'); View::assign('anid', $anid); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } $anid = $request->param('anid'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/answer/log?page='.$page.'&limit=10&anid='.$anid; if($request->param('success')){ $success = $request->param('success'); $url = $url.'&success='.$success; } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function answer_push_problem(){ $request = request(); $id = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/answer/push_problem?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function fission(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/fission/fissionsetting'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data,true); $setting = $dataarr['setting']; View::assign('data', $setting); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/fission/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function chat(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/chat_course_info'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataarr = json_decode($data,true); // $course = $dataarr['course']; $marking_account = $dataarr['marketing_account']; // 参数设置 View::assign('marketing_account', $marking_account); View::assign('course', $course); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function blacklist(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/chat_course_info'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataarr = json_decode($data,true); // $marking_account = $dataarr['marketing_account']; // 参数设置 View::assign('marketing_account', $marking_account); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/blacklist/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function waistcoat(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/chat_course_info'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 $dataarr = json_decode($data,true); // $marking_account = $dataarr['marketing_account']; // 参数设置 View::assign('marketing_account', $marking_account); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function waistcoat_add(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $picture = ''; $rs = $this->ossUploadBosslive('picture', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']); if ($rs['code'] === 0) { if (!empty($rs['data']['picture'])) { $picture = $rs['data']['picture']; } } $value = $request->param('value'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/add?value='.$value.'&picture='.$picture; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function waistcoat_edit(){ $request = request(); $id = $request->param('id'); $name = $request->param('name'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/edit?id='.$id.'&name='.$name; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function waistcoat_del(){ $request = request(); $id = $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/del?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function promoter(){ $request = request(); if (!$request->isAjax()) { //$this->promoterList(); $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/promoter_course'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 View::assign('course', json_decode($data,true)); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/grouplist?page='.$page.'&limit=10'; if($request->param('cid')){ $url .= '&cid='.$request->param('cid'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } private function promoterList(){ $page = 1; // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/index?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataraw = json_decode($data,true); $emplist = []; foreach($dataraw['data'] as $item){ $recordopen = CompanyBossOpen::where('unionid',$item['company']['unionid'])->find(); if(!$recordopen)return false; $emp = Employee::where(['unionid'=>$item['user']['unionid'],'root_id' => $recordopen->id])->find(); if($emp){ $emplist[] = ['id' => $emp['id'], 'unionid'=> $emp['unionid'],'org_id' => $emp['org_id'],'root_id' => $emp['root_id'] ]; } } //var_dump($emplist); // 返回数据 //return json_decode($data); } public function promoter_user(){ $request = request(); if (!$request->isAjax()) { View::assign('param', $request->param()); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } $id= $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/user?&id='.$id.'&page='.$page.'&limit=10'; if($request->param('cid')){ $cid = $request->param('cid'); $url = $url.'&cid='.$cid; } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function promoter_appoint(){ $request = request(); if (!$request->isAjax()) { View::assign('param', $request->param()); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } $id= $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/appoint?&id='.$id.'&page='.$page.'&limit=10'; if($request->param('cid')){ $cid = $request->param('cid'); $url = $url.'&cid='.$cid; } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function promoter_join(){ $request = request(); if (!$request->isAjax()) { View::assign('param', $request->param()); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } $id= $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/join?&id='.$id.'&page='.$page.'&limit=10'; if($request->param('cid')){ $cid = $request->param('cid'); $url = $url.'&cid='.$cid; } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function promoter_order(){ $request = request(); if (!$request->isAjax()) { View::assign('param', $request->param()); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } $id= $request->param('id'); $id= $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/order?&id='.$id.'&page='.$page.'&limit=10'; if($request->param('cid')){ $cid = $request->param('cid'); $url = $url.'&cid='.$cid; } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function promoter_scene(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/promoter_course'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 View::assign('course', json_decode($data,true)); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/scene?page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function promoter_qrcode(){ $request = request(); $groupId = $request->param('groupId'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/qrcode?groupId='.$groupId; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function promoter_addgroup(){ $request = request(); $name = $request->param('name'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/addgroup?name='.$name; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function promoter_editgroup(){ $request = request(); $id = $request->param('id'); $name = $request->param('name'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/editgroup?id='.$id.'&name='.$name; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function promoter_delgroup(){ $request = request(); $id = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/delgroup?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function customer(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/customer_course'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data,true); View::assign('course', json_decode($data,true)); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/index?page='.$page.'&limit=10'; if($request->param('name')){ $url .= '&name='.$request->param('name'); } if($request->param('nickname')){ $url .= '&nickname='.$request->param('nickname'); } if($request->param('mobile')){ $url .= '&mobile='.$request->param('mobile'); } if($request->param('orderNo')){ $url .= '&orderNo='.$request->param('orderNo'); } if($request->param('courseId')){ $url .= '&courseId='.$request->param('courseId'); } if($request->param('show') || $request->param('show') == 0){ $url .= '&show='.$request->param('show'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function order(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/index?page='.$page.'&limit=10'; if($request->param('name')){ $url .= '&name='.$request->param('name'); } if($request->param('mobile')){ $url .= '&mobile='.$request->param('mobile'); } if($request->param('orderNo')){ $url .= '&orderNo='.$request->param('orderNo'); } if($request->param('course')){ $url .= '&course='.$request->param('course'); } if($request->param('contact') || $request->param('contact') == 0){ $url .= '&contact='.$request->param('contact'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function order_no_pay(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/noPay?page='.$page.'&limit=10'; if($request->param('name')){ $url .= '&name='.$request->param('name'); } if($request->param('mobile')){ $url .= '&mobile='.$request->param('mobile'); } if($request->param('course')){ $url .= '&course='.$request->param('course'); } if($request->param('contact') || $request->param('contact') == 0){ $url .= '&contact='.$request->param('contact'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function present_order(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/present_course'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); View::assign('course', json_decode($data,true)); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/order?page='.$page.'&limit=10'; if($request->param('name')){ $url .= '&name='.$request->param('name'); } if($request->param('course_id')){ $url .= '&course_id='.$request->param('course_id'); } if($request->param('date')){ $url .= '&date='.$request->param('date'); } if($request->param('status') || $request->param('status') == 0){ $url .= '&status='.$request->param('status'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function gift(){ $request = request(); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/gift/gift_course'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $res = json_decode($data,true); View::assign('course',$res['course']); View::assign('type',$res['gift_tpye']); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/gift/index?page='.$page.'&limit=10'; if($request->param('type')){ $url .= '&type='.$request->param('type'); } if($request->param('course_id')){ $url .= '&course_id='.$request->param('course_id'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function order_course_pay(){ $request = request(); if (!$request->isAjax()) { return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/coursepay?page='.$page.'&limit=10'; if($request->param('orderNo')){ $url .= '&orderNo='.$request->param('orderNo'); } if($request->param('course')){ $url .= '&course='.$request->param('course'); } if($request->param('status') || $request->param('status') == 0){ $url .= '&status='.$request->param('status'); } $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } //////// public function course_links() { $request = request(); if ( ! $request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/links'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data, true); View::assign('imgsrc', $dataarr['imgsrc']); View::assign('wylinks', $dataarr['wylinks']); View::assign('pushlinks', $dataarr['pushlinks']); View::assign('pulllinks', $dataarr['pulllinks']); View::assign('sharelink', $dataarr['sharelink']); View::assign('sharelinkUrl', $dataarr['sharelinkUrl']); View::assign('courseId', $dataarr['courseId']); View::assign('courseTitle', $dataarr['courseTitle']); return View::fetch(); } } ////dashboard public function dashboard(){ $request = request(); if ( ! $request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/dashboard/dashboard'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data, true); View::assign('domain', $dataarr['domain']); View::assign('pushdomain', $dataarr['pushdomain']); View::assign('playdomain', $dataarr['playdomain']); View::assign('cmid', $dataarr['cmid']); View::assign('cmcode', $dataarr['cmcode']); View::assign('streamid', $dataarr['streamid']); View::assign('courseid', $dataarr['courseid']); View::assign('coursetoken', $dataarr['coursetoken']); View::assign('coursename', $dataarr['coursename']); View::assign('coursecover', $dataarr['coursecover']); View::assign('playaddr', $dataarr['playaddr']); View::assign('template', $dataarr['template']); View::assign('title', $dataarr['title']); cache('cid_by_ctoken_'.$dataarr['coursetoken'], $dataarr['courseid'], 10800);//3小时过期 return View::fetch(); } } public function redbagadd() { $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/add'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data, true); View::assign('datetime', $dataarr['datetime']); View::assign('cid', $dataarr['cid']); View::assign('num', $dataarr['num']); View::assign('money', $dataarr['money']); View::assign('freeze', $dataarr['freeze']); return View::fetch(); } public function redbagsave(){ $request = request(); $param = $request->param(); $price = $param['price']; $num = $param['num']; $cid = $param['cid']; $datetime = $param['datetime']; $lineNum = $param['lineNum']; // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/save?price='.$price.'&num='.$num.'&cid='.$cid.'&datetime='.$datetime.'&lineNum='.$lineNum; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function redbaglog() { $request = request(); $rdid = $request->param('id'); if (!$request->isAjax()) { View::assign('id', $rdid); return View::fetch(); } $page = 1; if($request->param('page')){ $page = $request->param('page'); } $rdid = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/log?page='.$page.'&limit=10&id='.$rdid; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function fission_qrcode(){ $url = 'https://'.config('app.bosslive_domain').'/saasapi/fission/qrcode'; $cmunionid = $this->getcmucode(); return curlparam($url,$cmunionid); } public function course_state(){ $request = request(); $cid = $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/state?id='.$cid; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function course_add(){ $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/add'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data, true); View::assign('teacher', $dataarr['teacher']); View::assign('teacherCount', $dataarr['teacherCount']); View::assign('cmid', $dataarr['cmid']); return View::fetch(); } public function course_edit(){ $request = request(); $id = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/edit?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data, true); View::assign('teacher', $dataarr['teacher']); View::assign('teacherCount', $dataarr['teacherCount']); View::assign('cmid', $dataarr['cmid']); View::assign('data', $dataarr['data']); View::assign('hasgifts', $dataarr['hasgifts']); return View::fetch(); } public function course_total(){ $request = request(); $cid = $request->param('id'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/total?id='.$cid; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function course_recordtheme(){ $request = request(); $cid = $request->param('cid'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/recordtheme?cid='.$cid; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data, true); View::assign('cid', $dataarr['cid']); return View::fetch(); } public function course_record_list(){ $request = request(); $cid = $request->param('cid'); // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/recordList?cid='.$cid; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function course_use_log(){ $request = request(); $cid = $request->param('cid'); if (!$request->isAjax()) { $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/course_use_log?cid='.$cid; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); $dataarr = json_decode($data, true); View::assign('cid', $dataarr['cid']); return View::fetch(); } // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/useLog?cid='.$cid.'&page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function course_appoint(){ $request = request(); $cid = $request->param('cid'); if (!$request->isAjax()) { View::assign('cid', $cid); return View::fetch(); } // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } // 获取分页相关参数 $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/appoint?cid='.$cid.'&page='.$page.'&limit=10'; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function course_save(){ $request = request(); $data = $request->param(); $rs = $this->ossUploadBosslive('cover', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']); if ($rs['code'] === 0) { if (!empty($rs['data']['cover'])) { $data['cover'] = $rs['data']['cover']; } } $paramstr = 'title='.$data['title'].'&description='.$data['description'].'&date='.$data['date'].'&hour='.$data['hour']; if (!empty($data['cover'])) { $paramstr = $paramstr.'&cover='.$data['cover']; } $paramstr = $paramstr.'&tid='.$data['tid'].'&content='.$data['content'].'&template='.$data['template'].'&record='.$data['record'].'&open_key='.$data['open_key']; $paramstr = $paramstr.'&key='.$data['key'].'&price='.$data['price']; if (!empty($data['id'])) { $paramstr = $paramstr.'&id='.$data['id']; } $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/save?'.$paramstr; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); //$url = 'https://'.config('app.bosslive_domain').'/saasapi/course/save?'; //$o = ""; //foreach ( $data as $k => $v ) //{ // $o.= "$k=" . urlencode( $v ). "&" ; //} //$post_data = substr($o,0,-1); //$res = curlparampost($url, $post_data); // 返回数据 return json_decode($data); } private function ossUploadBosslive($path, $exts) { $path = str_replace('\\', '/', $path); $filePath = []; // 检测要上传的文件格式是否正确 foreach ($_FILES as $key => $file) { if ($file['size'] == 0) { continue; } $ext = pathinfo($file['name'], PATHINFO_EXTENSION); if ( ! in_array($ext, $exts)) { return [ 'code' => 1, 'msg' => '文件格式不正确' ]; } $filePath[$key] = [ 'name' => $file['tmp_name'], 'ext' => $ext ]; } $accessKeyId = 'LTAI4FvHHdLarUBHLpJs2YNz'; $accessKeySecret = 'UEy6HgWOvMWbNqUHxZuBzs35leJHRD'; $endpoint = 'oss-cn-hangzhou.aliyuncs.com'; $bucket = 'wzh-live'; $oss = new OssClient($accessKeyId, $accessKeySecret, $endpoint); $path = trim($path, '/'); $data = []; foreach ($filePath as $key => $f) { $fileName = date('Ymd').'/'.date('His').rand(1000, 9999).'.'.$f['ext']; $p = $path.'/'.$fileName; $oss->uploadFile($bucket, $p, $f['name']); $data[$key] = $p; } return [ 'code' => 0, 'data' => $data ]; } ////// public function customer_msg(){ $request = request(); $uid = $request->param('uid'); if (!$request->isAjax()) { View::assign('uid', $uid); return View::fetch(); } // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/msg?uid='.$uid.'&page='.$page.'&limit=10'; if($request->param('date')){ $date = $request->param('date'); $url = $url.'&date='.$date; } // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function customer_gift(){ $request = request(); $uid = $request->param('uid'); if (!$request->isAjax()) { View::assign('uid', $uid); return View::fetch(); } // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/gift?uid='.$uid.'&page='.$page.'&limit=10'; if($request->param('date')){ $date = $request->param('date'); $url = $url.'&date='.$date; } // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function customer_visit(){ $request = request(); $uid = $request->param('uid'); if (!$request->isAjax()) { View::assign('uid', $uid); return View::fetch(); } // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/visit?uid='.$uid.'&page='.$page.'&limit=10'; if($request->param('date')){ $date = $request->param('date'); $url = $url.'&date='.$date; } // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function customer_redbag(){ $request = request(); $uid = $request->param('uid'); if (!$request->isAjax()) { View::assign('uid', $uid); return View::fetch(); } // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/redbag?uid='.$uid.'&page='.$page.'&limit=10'; if($request->param('date')){ $date = $request->param('date'); $url = $url.'&date='.$date; } // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function customer_remark(){ $request = request(); $uid = $request->param('uid'); if (!$request->isAjax()) { View::assign('uid', $uid); return View::fetch(); } // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/remark?uid='.$uid.'&page='.$page.'&limit=10'; if($request->param('date')){ $date = $request->param('date'); $url = $url.'&date='.$date; } // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return json_decode($data); } public function customer_doremark(){ $request = request(); $uid = $request->param('uid'); $content = $request->param('content'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/doremark?uid='.$uid.'&content='.$content; // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function customer_export(){ $request = request(); // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/export?page='.$page.'&limit=15'; if($request->param('name')){ $url = $url.'&name='.$request->param('name'); } if($request->param('nickname')){ $url = $url.'&nickname='.$request->param('nickname'); } if($request->param('mobile')){ $url = $url.'&mobile='.$request->param('mobile'); } if($request->param('courseId')){ $url = $url.'&courseId='.$request->param('courseId'); } if($request->param('show')){ $url = $url.'&show='.$request->param('show'); } // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function order_edit_contact(){ $request = request(); $id = $request->param('id'); $isContact = $request->param('isContact'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/editContact?id='.$id.'&isContact='.$isContact; // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function order_contact(){ $request = request(); $uid = $request->param('uid'); $gid = $request->param('gid'); $cid = $request->param('cid'); $name = $request->param('name'); $mobile = $request->param('mobile'); $isContact = $request->param('isContact'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/contact?uid='.$uid.'&isContact='.$isContact; $url = $url.'&gid='.$gid; $url = $url.'&cid='.$cid; $url = $url.'&name='.$name; $url = $url.'&mobile='.$mobile; // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function order_export(){ $request = request(); // 获取分页相关参数 $page = 1; if($request->param('page')){ $page = $request->param('page'); } $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/export?page='.$page.'&limit=15'; if($request->param('name')){ $url = $url.'&name='.$request->param('name'); } if($request->param('mobile')){ $url = $url.'&mobile='.$request->param('mobile'); } if($request->param('orderNo')){ $url = $url.'&orderNo='.$request->param('orderNo'); } if($request->param('course')){ $url = $url.'&course='.$request->param('course'); } if($request->param('contact')){ $url = $url.'&contact='.$request->param('contact'); } // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function present_enter_shop(){ $request = request(); $id = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/enterShop?id='.$id; // 获取分页相关参数 $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function goods_edit_sale_num(){ $request = request(); $id = $request->param('id'); $val = $request->param('val'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/edit_sale_num?id='.$id.'&val='.$val; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function goods_edit_queue_num(){ $request = request(); $id = $request->param('id'); $queue = $request->param('queue'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/edit_queue_num?id='.$id.'&queue='.$queue; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function goods_editStatus(){ $request = request(); $id = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/editStatus?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } public function goods_del(){ $request = request(); $id = $request->param('id'); $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/del?id='.$id; $cmunionid = $this->getcmucode(); $data = curlparam($url,$cmunionid); // 返回数据 return $data; } }