Broad.php 66 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052
  1. <?php
  2. namespace app\sys\controller;
  3. use app\model\Company;
  4. use app\model\CompanyBossOpen;
  5. use app\logics\Unionaccount;
  6. use think\facade\View;
  7. use OSS\Core\OssException;
  8. use OSS\OssClient;
  9. use app\model\Employee;
  10. class Broad
  11. {
  12. /**
  13. * 面板
  14. */
  15. public function index()
  16. {
  17. $condition = [
  18. ['root_id' ,'=', request()->employee->root_id],
  19. ['end_at', '>', date('Y-m-d'). ' 00:00:00']
  20. ];
  21. $companybossopened = CompanyBossOpen::where($condition)->find();
  22. $state = $companybossopened?1:0;
  23. if($state == 0){
  24. $way = 'free';
  25. if($way == 'free'){
  26. $root_id = request()->employee->root_id;
  27. View::assign('root_id', $root_id);
  28. View::assign('freetime', 30);
  29. return View::fetch('openning_free');
  30. }else{
  31. return View::fetch('openning');
  32. }
  33. }else{
  34. // 获取卡片数据
  35. $this->card();
  36. // 获取线型图数据
  37. $this->line();
  38. //$notice_status = model('company')->where('cmid', session('company', '', 'live'))->value('notice_status');
  39. View::assign('notice_status', 1);
  40. $content_status = 0;
  41. //$content = model('config')->where('field', 'companynotice')->value('content');
  42. //if (!empty($content)) {
  43. // $state = json_decode($content, true);
  44. // $content_status = $state['status'];
  45. //}
  46. View::assign('content_status', 0);
  47. return View::fetch('index');
  48. }
  49. }
  50. /**
  51. * 获取卡片数据
  52. */
  53. private function card()
  54. {
  55. // 打赏数据
  56. //$gift = model('giftLog')
  57. // ->field('IFNULL(sum(money),0) money, count(id) num')
  58. // ->where(['cmid' => session('company', '', 'live'), 'status' => 1])
  59. // ->find();
  60. $gift = ['money' =>10, 'num'=> 10];
  61. View::assign('gift', $gift);
  62. // 收订数据
  63. //$order = model('order')
  64. // ->field('IFNULL(sum(money),0) money, count(id) num')
  65. // ->where(['cmid' => session('company', '', 'live'), 'status' => 1])
  66. // ->find();
  67. $order = ['money' =>10, 'num'=> 10];
  68. View::assign('order', $order);
  69. // 裂变余额与裂变次数
  70. //$money = model('fission')->where('cmid', session('company', '', 'live'))->value('money');
  71. //$shareNum = model('shareLog')->where(['cmid' => session('company', '', 'live')])->count();
  72. $money = 1000;
  73. $shareNum = 200;
  74. View::assign('money', $money);
  75. View::assign('shareNum', $shareNum);
  76. // 账户到期时间及天数
  77. //$end = model('company')->where('cmid', session('company', '', 'live'))->value('end_date');
  78. //$day = floor((strtotime($end) - time() + 86400) / 86400);
  79. $end = '2023-12-31';
  80. $day = 365;
  81. View::assign('date', $end);
  82. View::assign('day', $day);
  83. // 账户余额获取
  84. //$yue = model('fission')->where('cmid', session('company', '', 'live'))->value('yue');
  85. $yue = 120000;
  86. View::assign('yue', $yue);
  87. }
  88. /**
  89. * 线型图数据
  90. */
  91. private function line()
  92. {
  93. // 设置日期(月)
  94. $thisMonth = date('n');
  95. $m1 = $m2 = [];
  96. $m = 1;
  97. while ($m <= 12) {
  98. $ms = $m;
  99. $m > $thisMonth ? $m2[] = $ms : $m1[] = $ms;
  100. $m++;
  101. }
  102. $month = array_merge($m2, $m1);
  103. // 年获取
  104. // 1)这个月的最后一天
  105. $lastDay = date('Y-m-d 23:59:59', strtotime('last day of this month'));
  106. $lastTime = strtotime($lastDay);
  107. // 2)上一年下个月的第一天
  108. $firstDay = date('Y-m-d 00:00:00', strtotime('first day of +1 month -1 year'));
  109. $firstTime = strtotime($firstDay);
  110. // x轴数据获取
  111. // 1)分享量
  112. //$share = model('shareLog')
  113. // ->where(['cmid' => session('company', '', 'live'), 'addtime' => ['between', [$firstTime, $lastTime]]])
  114. // ->group('m')
  115. // ->column("FROM_UNIXTIME(addtime,'%c') m, count(id) num");
  116. // 2)访问量
  117. //$login = WsLoginStatics::where(['cmid' => session('company', '', 'live'), 'first_login_time' => ['between', [$firstDay, $lastDay]]])
  118. // ->group('m')
  119. // ->column("DATE_FORMAT(first_login_time,'%c') m, count(id) num");
  120. // 3)订单量
  121. //$order = model('order')
  122. // ->where(['cmid' => session('company', '', 'live'), 'addtime' => ['between', [$firstDay, $lastDay]], 'status' => 1])
  123. // ->group('m')
  124. // ->column("DATE_FORMAT(addtime,'%c') m, count(id) num");
  125. // 数据整理
  126. //$shareArr = $loginArr = $orderArr = [];
  127. //foreach ($month as &$m) {
  128. // $shareArr[] = isset($share[$m]) ? $share[$m] : 0;
  129. // //$loginArr[] = isset($login[$m]) ? $login[$m] : 0;
  130. // $orderArr[] = isset($order[$m]) ? $order[$m] : 0;
  131. // $m .= '月';
  132. //}
  133. View::assign('shareArr', json_encode([]));
  134. View::assign('loginArr', json_encode([]));
  135. View::assign('orderArr', json_encode([]));
  136. View::assign('month', json_encode([]));
  137. }
  138. //////////////////////
  139. public function boss_openning($root_id){
  140. $company = Company::where(['root_id'=>$root_id])->find();
  141. if(!$company){
  142. return false;
  143. }
  144. $freetime = 30;
  145. $companybossopen = CompanyBossOpen::where(['root_id'=>$root_id])->find();
  146. if($companybossopen && $companybossopen->end_at < date('Y-m-d'). ' 00:00:00'){
  147. $updatedata = [
  148. 'end_at' => date('Y-m-d',strtotime('+'.$freetime.' day')),
  149. ];
  150. $companybossopen->save($updatedata);
  151. }else{
  152. //$productType = 'boss_live';
  153. $way = 'free';
  154. ///记录免费订单
  155. $insertdata = [
  156. 'company_name' => $company->company_name,
  157. 'company_id' => $company->id,
  158. 'root_id' => $root_id,
  159. 'unionid' => unionidgen(hanzi2pinyin($company->company_name),16),
  160. 'username' => hanzi2pinyin($company->company_name),
  161. 'way' => $way,
  162. 'start_at' => date('Y-m-d',time()),
  163. 'end_at' => date('Y-m-d',strtotime('+'.$freetime.' day')),
  164. 'remark' => ''
  165. ];
  166. (new CompanyBossOpen())->insert($insertdata);
  167. }
  168. //同步分平台账号
  169. $datastr = Unionaccount::syncaccount($company->id);
  170. $data = json_decode($datastr,true);
  171. if($data['code'] == 0 || $data['code'] == 2){
  172. return json(['code' => 0, 'msg' =>'成功开通Boss直播'.$freetime.'天免费期。']);
  173. }else{
  174. return json(['code' => 2, 'msg' =>$data['msg']]);
  175. }
  176. }
  177. ////////////////
  178. private function getcmucode(){
  179. $request = request();
  180. $root_id = $request->employee->root_id;
  181. $companybossopen = CompanyBossOpen::where(['root_id'=>$root_id])->find();
  182. $cmunionid = $companybossopen->unionid;
  183. return $cmunionid;
  184. }
  185. public function build(){
  186. $request = request();
  187. if (!$request->isAjax()) {
  188. return View::fetch();
  189. }
  190. $page = 1;
  191. if($request->param('page')){
  192. $page = $request->param('page');
  193. }
  194. // 获取分页相关参数
  195. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/index?page='.$page.'&limit=10';
  196. if($request->param('title')){
  197. $title = $request->param('title');
  198. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/index?page='.$page.'&limit=10&title='.$title;
  199. }
  200. $cmunionid = $this->getcmucode();
  201. $data = curlparam($url,$cmunionid);
  202. // 返回数据
  203. return json_decode($data);
  204. }
  205. public function goods(){
  206. $request = request();
  207. if (!$request->isAjax()) {
  208. return View::fetch();
  209. }
  210. $page = 1;
  211. if($request->param('page')){
  212. $page = $request->param('page');
  213. }
  214. // 获取分页相关参数
  215. $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/index?page='.$page.'&limit=10';
  216. $cmunionid = $this->getcmucode();
  217. $data = curlparam($url,$cmunionid);
  218. // 返回数据
  219. return json_decode($data);
  220. }
  221. public function goods_add(){
  222. $request = request();
  223. if (!$request->isAjax()) {
  224. return View::fetch();
  225. }
  226. $picture = '';
  227. $rs = $this->ossUploadBosslive('picture', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']);
  228. if ($rs['code'] === 0) {
  229. if (!empty($rs['data']['picture'])) {
  230. $picture = $rs['data']['picture'];
  231. }
  232. }
  233. $title = $request->param('title');
  234. $shop_price = $request->param('shop_price');
  235. $live_price = $request->param('live_price');
  236. $price = $request->param('price');
  237. $stock = $request->param('stock');
  238. $describe = $request->param('describe');
  239. $details = $request->param('details');
  240. // 获取分页相关参数
  241. $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/add?';
  242. $url .= 'title='.$title;
  243. $url .= '&shop_price='.$shop_price;
  244. $url .= '&live_price='.$live_price;
  245. $url .= '&price='.$price;
  246. $url .= '&stock='.$stock;
  247. $url .= '&picture='.$picture;
  248. $url .= '&describe='.$describe;
  249. $url .= '&details='.$details;
  250. $cmunionid = $this->getcmucode();
  251. $data = curlparam($url,$cmunionid);
  252. // 返回数据
  253. return json_decode($data);
  254. }
  255. public function course_setting(){
  256. $request = request();
  257. if (!$request->isAjax()) {
  258. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/setting';
  259. $cmunionid = $this->getcmucode();
  260. $data = curlparam($url,$cmunionid);
  261. // 返回数据
  262. $dataraw = json_decode($data, true);
  263. View::assign('company', $dataraw['data']['company']);
  264. View::assign('fission', $dataraw['data']['fission']);
  265. View::assign('teacherNum', $dataraw['data']['teacherNum']);
  266. return View::fetch();
  267. }
  268. }
  269. public function course_wxqrcode(){
  270. $request = request();
  271. if (!$request->isAjax()) {
  272. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/wxqrcode_cm_data';
  273. $cmunionid = $this->getcmucode();
  274. $data = curlparam($url,$cmunionid);
  275. // 返回数据
  276. $dataraw = json_decode($data, true);
  277. View::assign('company', $dataraw['company']);
  278. return View::fetch();
  279. }
  280. $official_account_qrcode = '';
  281. $rs = $this->ossUploadBosslive('official_account_qrcode', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']);
  282. if ($rs['code'] === 0) {
  283. if (!empty($rs['data']['official_account_qrcode'])) {
  284. $official_account_qrcode = $rs['data']['official_account_qrcode'];
  285. }
  286. }
  287. $subscribe = $request->param('subscribe');
  288. $oa_qrcode_url = $official_account_qrcode;
  289. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/wxqrcode?subscribe='.$subscribe.'&official_account_qrcode='.$oa_qrcode_url;
  290. $cmunionid = $this->getcmucode();
  291. $data = curlparam($url,$cmunionid);
  292. // 返回数据
  293. return json_decode($data);
  294. }
  295. public function course_slogan(){
  296. $request = request();
  297. if (!$request->isAjax()) {
  298. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/slogan_company';
  299. $cmunionid = $this->getcmucode();
  300. $data = curlparam($url,$cmunionid);
  301. // 返回数据
  302. $dataraw = json_decode($data, true);
  303. View::assign('company', $dataraw['company']);
  304. return View::fetch();
  305. }
  306. $slogan_state = $request->param('slogan_state');
  307. $slogan = $request->param('slogan');
  308. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/slogan?slogan_state='.$slogan_state.'&slogan='.$slogan;
  309. $cmunionid = $this->getcmucode();
  310. $data = curlparam($url,$cmunionid);
  311. // 返回数据
  312. return json_decode($data);
  313. }
  314. public function course_apilinkpushQr(){
  315. $request = request();
  316. $cid = $request->param('cid');
  317. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/apilinkpushQr?cid='.$cid;
  318. $cmunionid = $this->getcmucode();
  319. $data = curlparam($url,$cmunionid);
  320. //$url = json_decode($data,true);
  321. // 返回数据
  322. return $data;
  323. }
  324. public function keyword_index(){
  325. $request = request();
  326. if (!$request->isAjax()) {
  327. return View::fetch();
  328. }
  329. $page = 1;
  330. if($request->param('page')){
  331. $page = $request->param('page');
  332. }
  333. // 获取分页相关参数
  334. $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/index?page='.$page.'&limit=10';
  335. if($request->param('name')){
  336. $url .= '&name='.$request->param('name');
  337. }
  338. $cmunionid = $this->getcmucode();
  339. $data = curlparam($url,$cmunionid);
  340. // 返回数据
  341. return json_decode($data);
  342. }
  343. public function keyword_add(){
  344. $request = request();
  345. if (!$request->isAjax()) {
  346. return View::fetch();
  347. }
  348. $value = $request->param('value');
  349. // 获取分页相关参数
  350. $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/add?value='.$value;
  351. if($request->param('replace')){
  352. $url .= '&replace='.$request->param('replace');
  353. }
  354. $cmunionid = $this->getcmucode();
  355. $data = curlparam($url,$cmunionid);
  356. // 返回数据
  357. return json_decode($data);
  358. }
  359. public function keyword_edit(){
  360. $request = request();
  361. $id = $request->param('id');
  362. if (!$request->isAjax()) {
  363. $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/edit_data?id='.$id;
  364. $cmunionid = $this->getcmucode();
  365. $data = curlparam($url,$cmunionid);
  366. $dataraw = json_decode($data, true);
  367. View::assign('data', $dataraw['data']);
  368. return View::fetch();
  369. }
  370. $value = $request->param('value');
  371. // 获取分页相关参数
  372. $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/edit?id='.$id.'&value='.$value;
  373. $cmunionid = $this->getcmucode();
  374. $data = curlparam($url,$cmunionid);
  375. // 返回数据
  376. return json_decode($data);
  377. }
  378. public function keyword_del(){
  379. $request = request();
  380. $id = $request->param('id');
  381. // 获取分页相关参数
  382. $url = 'https://'.config('app.bosslive_domain').'/saasapi/keyword/del?id='.$id;
  383. $cmunionid = $this->getcmucode();
  384. $data = curlparam($url,$cmunionid);
  385. // 返回数据
  386. return $data;
  387. }
  388. public function present_index(){
  389. $request = request();
  390. if (!$request->isAjax()) {
  391. $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/index';
  392. $cmunionid = $this->getcmucode();
  393. $data = curlparam($url,$cmunionid);
  394. // 返回数据
  395. $dataraw = json_decode($data, true);
  396. View::assign('data', $dataraw['data']);
  397. View::assign('show', $dataraw['show']);
  398. return View::fetch();
  399. }
  400. }
  401. public function present_state(){
  402. $request = request();
  403. $state = $request->param('state');
  404. // 获取分页相关参数
  405. $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/state?state='.$state;
  406. $cmunionid = $this->getcmucode();
  407. $data = curlparam($url,$cmunionid);
  408. // 返回数据
  409. return $data;
  410. }
  411. public function present_show(){
  412. $request = request();
  413. $id = $request->param('id');
  414. $state = $request->param('state');
  415. // 获取分页相关参数
  416. $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/show?state='.$state.'&id='.$id;
  417. $cmunionid = $this->getcmucode();
  418. $data = curlparam($url,$cmunionid);
  419. // 返回数据
  420. return $data;
  421. }
  422. public function present_save(){
  423. $request = request();
  424. $name = $request->param('name');
  425. $price = $request->param('price');
  426. $num = $request->param('num');
  427. $show = $request->param('show');
  428. // 获取分页相关参数
  429. $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/save?name='.$name;
  430. $url .= '&price='.$price;
  431. $url .= '&num='.$num;
  432. $url .= '&show='.$show;
  433. $cmunionid = $this->getcmucode();
  434. $data = curlparam($url,$cmunionid);
  435. // 返回数据
  436. return $data;
  437. }
  438. public function present_delete(){
  439. $request = request();
  440. $id = $request->param('id');
  441. // 获取分页相关参数
  442. $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/delete?id='.$id;
  443. $cmunionid = $this->getcmucode();
  444. $data = curlparam($url,$cmunionid);
  445. // 返回数据
  446. return $data;
  447. }
  448. public function teacher_index(){
  449. $request = request();
  450. if (!$request->isAjax()) {
  451. return View::fetch();
  452. }
  453. $page = 1;
  454. if($request->param('page')){
  455. $page = $request->param('page');
  456. }
  457. // 获取分页相关参数
  458. $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/index?page='.$page.'&limit=10';
  459. if($request->param('name') && !empty($request->param('name'))){
  460. $url .= '&name='.$request->param('name');
  461. }
  462. $cmunionid = $this->getcmucode();
  463. $data = curlparam($url,$cmunionid);
  464. // 返回数据
  465. return json_decode($data);
  466. }
  467. public function teacher_add(){
  468. $request = request();
  469. if (!$request->isAjax()) {
  470. return View::fetch();
  471. }
  472. $name = $request->param('name');
  473. $phone = $request->param('phone');
  474. $vx = $request->param('vx');
  475. //$headimg = $request->param('headimg');
  476. $desc = $request->param('desc');
  477. $headimg = '';
  478. $rs = $this->ossUploadBosslive('headimg', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']);
  479. if ($rs['code'] === 0) {
  480. if (!empty($rs['data']['headimg'])) {
  481. $headimg = $rs['data']['headimg'];
  482. }
  483. }
  484. // 获取分页相关参数
  485. $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/add?';
  486. $url .= 'name='.$name;
  487. $url .= '&phone='.$phone;
  488. $url .= '&vx='.$vx;
  489. $url .= '&headimg='.$headimg;
  490. $url .= '&desc='.$desc;
  491. $cmunionid = $this->getcmucode();
  492. $data = curlparam($url,$cmunionid);
  493. // 返回数据
  494. return $data;
  495. }
  496. public function teacher_edit(){
  497. $request = request();
  498. $id = $request->param('id');
  499. if (!$request->isAjax()) {
  500. $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/teacher_train?id='.$id;
  501. $cmunionid = $this->getcmucode();
  502. $data = curlparam($url,$cmunionid);
  503. // 返回数据
  504. $dataraw = json_decode($data, true);
  505. View::assign('data', $dataraw['data']);
  506. return View::fetch();
  507. }
  508. $name = $request->param('name');
  509. $desc = $request->param('desc');
  510. $vx = $request->param('vx');
  511. $phone = $request->param('phone');
  512. // 获取分页相关参数
  513. $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/edit?id='.$id.'&name='.$name;
  514. $url .= '&desc='.$desc;
  515. $url .= '&vx='.$vx;
  516. $url .= '&phone='.$phone;
  517. $cmunionid = $this->getcmucode();
  518. $data = curlparam($url,$cmunionid);
  519. // 返回数据
  520. return $data;
  521. }
  522. public function teacher_del(){
  523. $request = request();
  524. $id = $request->param('id');
  525. // 获取分页相关参数
  526. $url = 'https://'.config('app.bosslive_domain').'/saasapi/teacher/del?id='.$id;
  527. $cmunionid = $this->getcmucode();
  528. $data = curlparam($url,$cmunionid);
  529. // 返回数据
  530. return $data;
  531. }
  532. public function white_list_index(){
  533. $request = request();
  534. if (!$request->isAjax()) {
  535. return View::fetch();
  536. }
  537. $page = 1;
  538. if($request->param('page')){
  539. $page = $request->param('page');
  540. }
  541. // 获取分页相关参数
  542. $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/index?page='.$page.'&limit=10';
  543. $cmunionid = $this->getcmucode();
  544. $data = curlparam($url,$cmunionid);
  545. // 返回数据
  546. return json_decode($data);
  547. }
  548. public function white_list_qrcode(){
  549. $request = request();
  550. if (!$request->isAjax()) {
  551. $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/qrcode';
  552. $cmunionid = $this->getcmucode();
  553. $data = curlparam($url,$cmunionid);
  554. // 返回数据
  555. $dataraw = json_decode($data, true);
  556. View::assign('qrcode', $dataraw['qrcode']);
  557. View::assign('open', $dataraw['open']);
  558. View::assign('contacts_qrcode', $dataraw['contacts_qrcode']);
  559. return View::fetch();
  560. }
  561. }
  562. public function white_list_state(){
  563. $request = request();
  564. $state = $request->param('state');
  565. $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/state?state='.$state;
  566. $cmunionid = $this->getcmucode();
  567. $data = curlparam($url,$cmunionid);
  568. // 返回数据
  569. return $data;
  570. }
  571. public function white_list_join(){
  572. $request = request();
  573. $id = $request->param('id');
  574. $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/join?id='.$id;
  575. $cmunionid = $this->getcmucode();
  576. $data = curlparam($url,$cmunionid);
  577. // 返回数据
  578. return $data;
  579. }
  580. public function white_list_del(){
  581. $request = request();
  582. $id = $request->param('id');
  583. $url = 'https://'.config('app.bosslive_domain').'/saasapi/white_list/del?id='.$id;
  584. $cmunionid = $this->getcmucode();
  585. $data = curlparam($url,$cmunionid);
  586. // 返回数据
  587. return $data;
  588. }
  589. public function redbag(){
  590. // $fission = model('fission')->where('cmid', session('company', '', 'live'))->find();
  591. // $this->assign('money', round($fission->money-$fission->freeze, 2));
  592. // return $this->fetch();
  593. $request = request();
  594. if (!$request->isAjax()) {
  595. $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/redbag_fission_num';
  596. $cmunionid = $this->getcmucode();
  597. $data = curlparam($url,$cmunionid);
  598. $dataarr = json_decode($data,true);
  599. $money = $dataarr['num'];
  600. View::assign('money', $money);
  601. return View::fetch();
  602. }
  603. $page = 1;
  604. if($request->param('page')){
  605. $page = $request->param('page');
  606. }
  607. // 获取分页相关参数
  608. $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/index?page='.$page.'&limit=10';
  609. $cmunionid = $this->getcmucode();
  610. $data = curlparam($url,$cmunionid);
  611. // 返回数据
  612. return json_decode($data);
  613. }
  614. public function answer(){
  615. $request = request();
  616. if (!$request->isAjax()) {
  617. //$url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/redbag_fission_num';
  618. //$cmunionid = $this->getcmucode();
  619. //$data = curlparam($url,$cmunionid);
  620. //$dataarr = json_decode($data,true);
  621. //
  622. //$money = $dataarr['num'];
  623. //View::assign('money', $money);
  624. return View::fetch();
  625. }
  626. $page = 1;
  627. if($request->param('page')){
  628. $page = $request->param('page');
  629. }
  630. // 获取分页相关参数
  631. $url = 'https://'.config('app.bosslive_domain').'/saasapi/answer/index?page='.$page.'&limit=10';
  632. $cmunionid = $this->getcmucode();
  633. $data = curlparam($url,$cmunionid);
  634. // 返回数据
  635. return json_decode($data);
  636. }
  637. public function answer_add(){
  638. $request = request();
  639. if (!$request->isAjax()) {
  640. return View::fetch();
  641. }
  642. $title = $request->param('title');
  643. $like = $request->param('like');
  644. $valueArr = $request->param('value');
  645. $value = implode(',', $valueArr);
  646. // 获取分页相关参数
  647. $url = 'https://'.config('app.bosslive_domain').'/saasapi/answer/add?title='.$title;
  648. $url .= '&like='.$like;
  649. $url .= '&value='.$value;
  650. $cmunionid = $this->getcmucode();
  651. $data = curlparam($url,$cmunionid);
  652. // 返回数据
  653. return json_decode($data);
  654. }
  655. public function answer_log(){
  656. $request = request();
  657. if (!$request->isAjax()) {
  658. $anid = $request->param('anid');
  659. View::assign('anid', $anid);
  660. return View::fetch();
  661. }
  662. $page = 1;
  663. if($request->param('page')){
  664. $page = $request->param('page');
  665. }
  666. $anid = $request->param('anid');
  667. // 获取分页相关参数
  668. $url = 'https://'.config('app.bosslive_domain').'/saasapi/answer/log?page='.$page.'&limit=10&anid='.$anid;
  669. if($request->param('success')){
  670. $success = $request->param('success');
  671. $url = $url.'&success='.$success;
  672. }
  673. $cmunionid = $this->getcmucode();
  674. $data = curlparam($url,$cmunionid);
  675. // 返回数据
  676. return json_decode($data);
  677. }
  678. public function answer_push_problem(){
  679. $request = request();
  680. $id = $request->param('id');
  681. $url = 'https://'.config('app.bosslive_domain').'/saasapi/answer/push_problem?id='.$id;
  682. $cmunionid = $this->getcmucode();
  683. $data = curlparam($url,$cmunionid);
  684. // 返回数据
  685. return $data;
  686. }
  687. public function fission(){
  688. $request = request();
  689. if (!$request->isAjax()) {
  690. $url = 'https://'.config('app.bosslive_domain').'/saasapi/fission/fissionsetting';
  691. $cmunionid = $this->getcmucode();
  692. $data = curlparam($url,$cmunionid);
  693. $dataarr = json_decode($data,true);
  694. $setting = $dataarr['setting'];
  695. View::assign('data', $setting);
  696. return View::fetch();
  697. }
  698. $page = 1;
  699. if($request->param('page')){
  700. $page = $request->param('page');
  701. }
  702. // 获取分页相关参数
  703. $url = 'https://'.config('app.bosslive_domain').'/saasapi/fission/index?page='.$page.'&limit=10';
  704. $cmunionid = $this->getcmucode();
  705. $data = curlparam($url,$cmunionid);
  706. // 返回数据
  707. return json_decode($data);
  708. }
  709. public function chat(){
  710. $request = request();
  711. if (!$request->isAjax()) {
  712. $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/chat_course_info';
  713. $cmunionid = $this->getcmucode();
  714. $data = curlparam($url,$cmunionid);
  715. // 返回数据
  716. $dataarr = json_decode($data,true);
  717. //
  718. $course = $dataarr['course'];
  719. $marking_account = $dataarr['marketing_account'];
  720. // 参数设置
  721. View::assign('marketing_account', $marking_account);
  722. View::assign('course', $course);
  723. return View::fetch();
  724. }
  725. $page = 1;
  726. if($request->param('page')){
  727. $page = $request->param('page');
  728. }
  729. // 获取分页相关参数
  730. $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/index?page='.$page.'&limit=10';
  731. $cmunionid = $this->getcmucode();
  732. $data = curlparam($url,$cmunionid);
  733. // 返回数据
  734. return json_decode($data);
  735. }
  736. public function blacklist(){
  737. $request = request();
  738. if (!$request->isAjax()) {
  739. $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/chat_course_info';
  740. $cmunionid = $this->getcmucode();
  741. $data = curlparam($url,$cmunionid);
  742. // 返回数据
  743. $dataarr = json_decode($data,true);
  744. //
  745. $marking_account = $dataarr['marketing_account'];
  746. // 参数设置
  747. View::assign('marketing_account', $marking_account);
  748. return View::fetch();
  749. }
  750. $page = 1;
  751. if($request->param('page')){
  752. $page = $request->param('page');
  753. }
  754. // 获取分页相关参数
  755. $url = 'https://'.config('app.bosslive_domain').'/saasapi/blacklist/index?page='.$page.'&limit=10';
  756. $cmunionid = $this->getcmucode();
  757. $data = curlparam($url,$cmunionid);
  758. // 返回数据
  759. return json_decode($data);
  760. }
  761. public function waistcoat(){
  762. $request = request();
  763. if (!$request->isAjax()) {
  764. $url = 'https://'.config('app.bosslive_domain').'/saasapi/chat/chat_course_info';
  765. $cmunionid = $this->getcmucode();
  766. $data = curlparam($url,$cmunionid);
  767. // 返回数据
  768. $dataarr = json_decode($data,true);
  769. //
  770. $marking_account = $dataarr['marketing_account'];
  771. // 参数设置
  772. View::assign('marketing_account', $marking_account);
  773. return View::fetch();
  774. }
  775. $page = 1;
  776. if($request->param('page')){
  777. $page = $request->param('page');
  778. }
  779. // 获取分页相关参数
  780. $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/index?page='.$page.'&limit=10';
  781. $cmunionid = $this->getcmucode();
  782. $data = curlparam($url,$cmunionid);
  783. // 返回数据
  784. return json_decode($data);
  785. }
  786. public function waistcoat_add(){
  787. $request = request();
  788. if (!$request->isAjax()) {
  789. return View::fetch();
  790. }
  791. $picture = '';
  792. $rs = $this->ossUploadBosslive('picture', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']);
  793. if ($rs['code'] === 0) {
  794. if (!empty($rs['data']['picture'])) {
  795. $picture = $rs['data']['picture'];
  796. }
  797. }
  798. $value = $request->param('value');
  799. // 获取分页相关参数
  800. $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/add?value='.$value.'&picture='.$picture;
  801. $cmunionid = $this->getcmucode();
  802. $data = curlparam($url,$cmunionid);
  803. // 返回数据
  804. return $data;
  805. }
  806. public function waistcoat_edit(){
  807. $request = request();
  808. $id = $request->param('id');
  809. $name = $request->param('name');
  810. // 获取分页相关参数
  811. $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/edit?id='.$id.'&name='.$name;
  812. $cmunionid = $this->getcmucode();
  813. $data = curlparam($url,$cmunionid);
  814. // 返回数据
  815. return $data;
  816. }
  817. public function waistcoat_del(){
  818. $request = request();
  819. $id = $request->param('id');
  820. // 获取分页相关参数
  821. $url = 'https://'.config('app.bosslive_domain').'/saasapi/waistcoat/del?id='.$id;
  822. $cmunionid = $this->getcmucode();
  823. $data = curlparam($url,$cmunionid);
  824. // 返回数据
  825. return $data;
  826. }
  827. public function promoter(){
  828. $request = request();
  829. if (!$request->isAjax()) {
  830. //$this->promoterList();
  831. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/promoter_course';
  832. $cmunionid = $this->getcmucode();
  833. $data = curlparam($url,$cmunionid);
  834. // 返回数据
  835. View::assign('course', json_decode($data,true));
  836. return View::fetch();
  837. }
  838. $page = 1;
  839. if($request->param('page')){
  840. $page = $request->param('page');
  841. }
  842. // 获取分页相关参数
  843. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/grouplist?page='.$page.'&limit=10';
  844. if($request->param('cid')){
  845. $url .= '&cid='.$request->param('cid');
  846. }
  847. $cmunionid = $this->getcmucode();
  848. $data = curlparam($url,$cmunionid);
  849. // 返回数据
  850. return json_decode($data);
  851. }
  852. private function promoterList(){
  853. $page = 1;
  854. // 获取分页相关参数
  855. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/index?page='.$page.'&limit=10';
  856. $cmunionid = $this->getcmucode();
  857. $data = curlparam($url,$cmunionid);
  858. $dataraw = json_decode($data,true);
  859. $emplist = [];
  860. foreach($dataraw['data'] as $item){
  861. $recordopen = CompanyBossOpen::where('unionid',$item['company']['unionid'])->find();
  862. if(!$recordopen)return false;
  863. $emp = Employee::where(['unionid'=>$item['user']['unionid'],'root_id' => $recordopen->id])->find();
  864. if($emp){
  865. $emplist[] = ['id' => $emp['id'], 'unionid'=> $emp['unionid'],'org_id' => $emp['org_id'],'root_id' => $emp['root_id'] ];
  866. }
  867. }
  868. //var_dump($emplist);
  869. // 返回数据
  870. //return json_decode($data);
  871. }
  872. public function promoter_user(){
  873. $request = request();
  874. if (!$request->isAjax()) {
  875. View::assign('param', $request->param());
  876. return View::fetch();
  877. }
  878. $page = 1;
  879. if($request->param('page')){
  880. $page = $request->param('page');
  881. }
  882. $id= $request->param('id');
  883. // 获取分页相关参数
  884. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/user?&id='.$id.'&page='.$page.'&limit=10';
  885. if($request->param('cid')){
  886. $cid = $request->param('cid');
  887. $url = $url.'&cid='.$cid;
  888. }
  889. $cmunionid = $this->getcmucode();
  890. $data = curlparam($url,$cmunionid);
  891. // 返回数据
  892. return json_decode($data);
  893. }
  894. public function promoter_appoint(){
  895. $request = request();
  896. if (!$request->isAjax()) {
  897. View::assign('param', $request->param());
  898. return View::fetch();
  899. }
  900. $page = 1;
  901. if($request->param('page')){
  902. $page = $request->param('page');
  903. }
  904. $id= $request->param('id');
  905. // 获取分页相关参数
  906. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/appoint?&id='.$id.'&page='.$page.'&limit=10';
  907. if($request->param('cid')){
  908. $cid = $request->param('cid');
  909. $url = $url.'&cid='.$cid;
  910. }
  911. $cmunionid = $this->getcmucode();
  912. $data = curlparam($url,$cmunionid);
  913. // 返回数据
  914. return json_decode($data);
  915. }
  916. public function promoter_join(){
  917. $request = request();
  918. if (!$request->isAjax()) {
  919. View::assign('param', $request->param());
  920. return View::fetch();
  921. }
  922. $page = 1;
  923. if($request->param('page')){
  924. $page = $request->param('page');
  925. }
  926. $id= $request->param('id');
  927. // 获取分页相关参数
  928. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/join?&id='.$id.'&page='.$page.'&limit=10';
  929. if($request->param('cid')){
  930. $cid = $request->param('cid');
  931. $url = $url.'&cid='.$cid;
  932. }
  933. $cmunionid = $this->getcmucode();
  934. $data = curlparam($url,$cmunionid);
  935. // 返回数据
  936. return json_decode($data);
  937. }
  938. public function promoter_order(){
  939. $request = request();
  940. if (!$request->isAjax()) {
  941. View::assign('param', $request->param());
  942. return View::fetch();
  943. }
  944. $page = 1;
  945. if($request->param('page')){
  946. $page = $request->param('page');
  947. }
  948. $id= $request->param('id');
  949. $id= $request->param('id');
  950. // 获取分页相关参数
  951. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/order?&id='.$id.'&page='.$page.'&limit=10';
  952. if($request->param('cid')){
  953. $cid = $request->param('cid');
  954. $url = $url.'&cid='.$cid;
  955. }
  956. $cmunionid = $this->getcmucode();
  957. $data = curlparam($url,$cmunionid);
  958. // 返回数据
  959. return json_decode($data);
  960. }
  961. public function promoter_scene(){
  962. $request = request();
  963. if (!$request->isAjax()) {
  964. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/promoter_course';
  965. $cmunionid = $this->getcmucode();
  966. $data = curlparam($url,$cmunionid);
  967. // 返回数据
  968. View::assign('course', json_decode($data,true));
  969. return View::fetch();
  970. }
  971. $page = 1;
  972. if($request->param('page')){
  973. $page = $request->param('page');
  974. }
  975. // 获取分页相关参数
  976. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/scene?page='.$page.'&limit=10';
  977. $cmunionid = $this->getcmucode();
  978. $data = curlparam($url,$cmunionid);
  979. // 返回数据
  980. return json_decode($data);
  981. }
  982. public function promoter_qrcode(){
  983. $request = request();
  984. $groupId = $request->param('groupId');
  985. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/qrcode?groupId='.$groupId;
  986. $cmunionid = $this->getcmucode();
  987. $data = curlparam($url,$cmunionid);
  988. // 返回数据
  989. return $data;
  990. }
  991. public function promoter_addgroup(){
  992. $request = request();
  993. $name = $request->param('name');
  994. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/addgroup?name='.$name;
  995. $cmunionid = $this->getcmucode();
  996. $data = curlparam($url,$cmunionid);
  997. // 返回数据
  998. return $data;
  999. }
  1000. public function promoter_editgroup(){
  1001. $request = request();
  1002. $id = $request->param('id');
  1003. $name = $request->param('name');
  1004. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/editgroup?id='.$id.'&name='.$name;
  1005. $cmunionid = $this->getcmucode();
  1006. $data = curlparam($url,$cmunionid);
  1007. // 返回数据
  1008. return $data;
  1009. }
  1010. public function promoter_delgroup(){
  1011. $request = request();
  1012. $id = $request->param('id');
  1013. $url = 'https://'.config('app.bosslive_domain').'/saasapi/promoter/delgroup?id='.$id;
  1014. $cmunionid = $this->getcmucode();
  1015. $data = curlparam($url,$cmunionid);
  1016. // 返回数据
  1017. return $data;
  1018. }
  1019. public function customer(){
  1020. $request = request();
  1021. if (!$request->isAjax()) {
  1022. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/customer_course';
  1023. $cmunionid = $this->getcmucode();
  1024. $data = curlparam($url,$cmunionid);
  1025. $dataarr = json_decode($data,true);
  1026. View::assign('course', json_decode($data,true));
  1027. return View::fetch();
  1028. }
  1029. $page = 1;
  1030. if($request->param('page')){
  1031. $page = $request->param('page');
  1032. }
  1033. // 获取分页相关参数
  1034. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/index?page='.$page.'&limit=10';
  1035. if($request->param('name')){
  1036. $url .= '&name='.$request->param('name');
  1037. }
  1038. if($request->param('nickname')){
  1039. $url .= '&nickname='.$request->param('nickname');
  1040. }
  1041. if($request->param('mobile')){
  1042. $url .= '&mobile='.$request->param('mobile');
  1043. }
  1044. if($request->param('orderNo')){
  1045. $url .= '&orderNo='.$request->param('orderNo');
  1046. }
  1047. if($request->param('courseId')){
  1048. $url .= '&courseId='.$request->param('courseId');
  1049. }
  1050. if($request->param('show') || $request->param('show') == 0){
  1051. $url .= '&show='.$request->param('show');
  1052. }
  1053. $cmunionid = $this->getcmucode();
  1054. $data = curlparam($url,$cmunionid);
  1055. // 返回数据
  1056. return json_decode($data);
  1057. }
  1058. public function order(){
  1059. $request = request();
  1060. if (!$request->isAjax()) {
  1061. return View::fetch();
  1062. }
  1063. $page = 1;
  1064. if($request->param('page')){
  1065. $page = $request->param('page');
  1066. }
  1067. // 获取分页相关参数
  1068. $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/index?page='.$page.'&limit=10';
  1069. if($request->param('name')){
  1070. $url .= '&name='.$request->param('name');
  1071. }
  1072. if($request->param('mobile')){
  1073. $url .= '&mobile='.$request->param('mobile');
  1074. }
  1075. if($request->param('orderNo')){
  1076. $url .= '&orderNo='.$request->param('orderNo');
  1077. }
  1078. if($request->param('course')){
  1079. $url .= '&course='.$request->param('course');
  1080. }
  1081. if($request->param('contact') || $request->param('contact') == 0){
  1082. $url .= '&contact='.$request->param('contact');
  1083. }
  1084. $cmunionid = $this->getcmucode();
  1085. $data = curlparam($url,$cmunionid);
  1086. // 返回数据
  1087. return json_decode($data);
  1088. }
  1089. public function order_no_pay(){
  1090. $request = request();
  1091. if (!$request->isAjax()) {
  1092. return View::fetch();
  1093. }
  1094. $page = 1;
  1095. if($request->param('page')){
  1096. $page = $request->param('page');
  1097. }
  1098. // 获取分页相关参数
  1099. $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/noPay?page='.$page.'&limit=10';
  1100. if($request->param('name')){
  1101. $url .= '&name='.$request->param('name');
  1102. }
  1103. if($request->param('mobile')){
  1104. $url .= '&mobile='.$request->param('mobile');
  1105. }
  1106. if($request->param('course')){
  1107. $url .= '&course='.$request->param('course');
  1108. }
  1109. if($request->param('contact') || $request->param('contact') == 0){
  1110. $url .= '&contact='.$request->param('contact');
  1111. }
  1112. $cmunionid = $this->getcmucode();
  1113. $data = curlparam($url,$cmunionid);
  1114. // 返回数据
  1115. return json_decode($data);
  1116. }
  1117. public function present_order(){
  1118. $request = request();
  1119. if (!$request->isAjax()) {
  1120. $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/present_course';
  1121. $cmunionid = $this->getcmucode();
  1122. $data = curlparam($url,$cmunionid);
  1123. View::assign('course', json_decode($data,true));
  1124. return View::fetch();
  1125. }
  1126. $page = 1;
  1127. if($request->param('page')){
  1128. $page = $request->param('page');
  1129. }
  1130. // 获取分页相关参数
  1131. $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/order?page='.$page.'&limit=10';
  1132. if($request->param('name')){
  1133. $url .= '&name='.$request->param('name');
  1134. }
  1135. if($request->param('course_id')){
  1136. $url .= '&course_id='.$request->param('course_id');
  1137. }
  1138. if($request->param('date')){
  1139. $url .= '&date='.$request->param('date');
  1140. }
  1141. if($request->param('status') || $request->param('status') == 0){
  1142. $url .= '&status='.$request->param('status');
  1143. }
  1144. $cmunionid = $this->getcmucode();
  1145. $data = curlparam($url,$cmunionid);
  1146. // 返回数据
  1147. return json_decode($data);
  1148. }
  1149. public function gift(){
  1150. $request = request();
  1151. if (!$request->isAjax()) {
  1152. $url = 'https://'.config('app.bosslive_domain').'/saasapi/gift/gift_course';
  1153. $cmunionid = $this->getcmucode();
  1154. $data = curlparam($url,$cmunionid);
  1155. $res = json_decode($data,true);
  1156. View::assign('course',$res['course']);
  1157. View::assign('type',$res['gift_tpye']);
  1158. return View::fetch();
  1159. }
  1160. $page = 1;
  1161. if($request->param('page')){
  1162. $page = $request->param('page');
  1163. }
  1164. // 获取分页相关参数
  1165. $url = 'https://'.config('app.bosslive_domain').'/saasapi/gift/index?page='.$page.'&limit=10';
  1166. if($request->param('type')){
  1167. $url .= '&type='.$request->param('type');
  1168. }
  1169. if($request->param('course_id')){
  1170. $url .= '&course_id='.$request->param('course_id');
  1171. }
  1172. $cmunionid = $this->getcmucode();
  1173. $data = curlparam($url,$cmunionid);
  1174. // 返回数据
  1175. return json_decode($data);
  1176. }
  1177. public function order_course_pay(){
  1178. $request = request();
  1179. if (!$request->isAjax()) {
  1180. return View::fetch();
  1181. }
  1182. $page = 1;
  1183. if($request->param('page')){
  1184. $page = $request->param('page');
  1185. }
  1186. // 获取分页相关参数
  1187. $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/coursepay?page='.$page.'&limit=10';
  1188. if($request->param('orderNo')){
  1189. $url .= '&orderNo='.$request->param('orderNo');
  1190. }
  1191. if($request->param('course')){
  1192. $url .= '&course='.$request->param('course');
  1193. }
  1194. if($request->param('status') || $request->param('status') == 0){
  1195. $url .= '&status='.$request->param('status');
  1196. }
  1197. $cmunionid = $this->getcmucode();
  1198. $data = curlparam($url,$cmunionid);
  1199. // 返回数据
  1200. return json_decode($data);
  1201. }
  1202. ////////
  1203. public function course_links()
  1204. {
  1205. $request = request();
  1206. if ( ! $request->isAjax()) {
  1207. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/links';
  1208. $cmunionid = $this->getcmucode();
  1209. $data = curlparam($url,$cmunionid);
  1210. $dataarr = json_decode($data, true);
  1211. View::assign('imgsrc', $dataarr['imgsrc']);
  1212. View::assign('wylinks', $dataarr['wylinks']);
  1213. View::assign('pushlinks', $dataarr['pushlinks']);
  1214. View::assign('pulllinks', $dataarr['pulllinks']);
  1215. View::assign('sharelink', $dataarr['sharelink']);
  1216. View::assign('sharelinkUrl', $dataarr['sharelinkUrl']);
  1217. View::assign('courseId', $dataarr['courseId']);
  1218. View::assign('courseTitle', $dataarr['courseTitle']);
  1219. return View::fetch();
  1220. }
  1221. }
  1222. ////dashboard
  1223. public function dashboard(){
  1224. $request = request();
  1225. if ( ! $request->isAjax()) {
  1226. $url = 'https://'.config('app.bosslive_domain').'/saasapi/dashboard/dashboard';
  1227. $cmunionid = $this->getcmucode();
  1228. $data = curlparam($url,$cmunionid);
  1229. $dataarr = json_decode($data, true);
  1230. View::assign('domain', $dataarr['domain']);
  1231. View::assign('pushdomain', $dataarr['pushdomain']);
  1232. View::assign('playdomain', $dataarr['playdomain']);
  1233. View::assign('cmid', $dataarr['cmid']);
  1234. View::assign('cmcode', $dataarr['cmcode']);
  1235. View::assign('streamid', $dataarr['streamid']);
  1236. View::assign('courseid', $dataarr['courseid']);
  1237. View::assign('coursetoken', $dataarr['coursetoken']);
  1238. View::assign('coursename', $dataarr['coursename']);
  1239. View::assign('coursecover', $dataarr['coursecover']);
  1240. View::assign('playaddr', $dataarr['playaddr']);
  1241. View::assign('template', $dataarr['template']);
  1242. View::assign('title', $dataarr['title']);
  1243. cache('cid_by_ctoken_'.$dataarr['coursetoken'], $dataarr['courseid'], 10800);//3小时过期
  1244. return View::fetch();
  1245. }
  1246. }
  1247. public function redbagadd()
  1248. {
  1249. $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/add';
  1250. $cmunionid = $this->getcmucode();
  1251. $data = curlparam($url,$cmunionid);
  1252. $dataarr = json_decode($data, true);
  1253. View::assign('datetime', $dataarr['datetime']);
  1254. View::assign('cid', $dataarr['cid']);
  1255. View::assign('num', $dataarr['num']);
  1256. View::assign('money', $dataarr['money']);
  1257. View::assign('freeze', $dataarr['freeze']);
  1258. return View::fetch();
  1259. }
  1260. public function redbagsave(){
  1261. $request = request();
  1262. $param = $request->param();
  1263. $price = $param['price'];
  1264. $num = $param['num'];
  1265. $cid = $param['cid'];
  1266. $datetime = $param['datetime'];
  1267. $lineNum = $param['lineNum'];
  1268. // 获取分页相关参数
  1269. $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/save?price='.$price.'&num='.$num.'&cid='.$cid.'&datetime='.$datetime.'&lineNum='.$lineNum;
  1270. $cmunionid = $this->getcmucode();
  1271. $data = curlparam($url,$cmunionid);
  1272. // 返回数据
  1273. return json_decode($data);
  1274. }
  1275. public function redbaglog()
  1276. {
  1277. $request = request();
  1278. $rdid = $request->param('id');
  1279. if (!$request->isAjax()) {
  1280. View::assign('id', $rdid);
  1281. return View::fetch();
  1282. }
  1283. $page = 1;
  1284. if($request->param('page')){
  1285. $page = $request->param('page');
  1286. }
  1287. $rdid = $request->param('id');
  1288. $url = 'https://'.config('app.bosslive_domain').'/saasapi/redbag/log?page='.$page.'&limit=10&id='.$rdid;
  1289. $cmunionid = $this->getcmucode();
  1290. $data = curlparam($url,$cmunionid);
  1291. // 返回数据
  1292. return json_decode($data);
  1293. }
  1294. public function fission_qrcode(){
  1295. $url = 'https://'.config('app.bosslive_domain').'/saasapi/fission/qrcode';
  1296. $cmunionid = $this->getcmucode();
  1297. return curlparam($url,$cmunionid);
  1298. }
  1299. public function course_state(){
  1300. $request = request();
  1301. $cid = $request->param('id');
  1302. // 获取分页相关参数
  1303. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/state?id='.$cid;
  1304. $cmunionid = $this->getcmucode();
  1305. $data = curlparam($url,$cmunionid);
  1306. // 返回数据
  1307. return $data;
  1308. }
  1309. public function course_add(){
  1310. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/add';
  1311. $cmunionid = $this->getcmucode();
  1312. $data = curlparam($url,$cmunionid);
  1313. $dataarr = json_decode($data, true);
  1314. View::assign('teacher', $dataarr['teacher']);
  1315. View::assign('teacherCount', $dataarr['teacherCount']);
  1316. View::assign('cmid', $dataarr['cmid']);
  1317. return View::fetch();
  1318. }
  1319. public function course_edit(){
  1320. $request = request();
  1321. $id = $request->param('id');
  1322. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/edit?id='.$id;
  1323. $cmunionid = $this->getcmucode();
  1324. $data = curlparam($url,$cmunionid);
  1325. $dataarr = json_decode($data, true);
  1326. View::assign('teacher', $dataarr['teacher']);
  1327. View::assign('teacherCount', $dataarr['teacherCount']);
  1328. View::assign('cmid', $dataarr['cmid']);
  1329. View::assign('data', $dataarr['data']);
  1330. View::assign('hasgifts', $dataarr['hasgifts']);
  1331. return View::fetch();
  1332. }
  1333. public function course_total(){
  1334. $request = request();
  1335. $cid = $request->param('id');
  1336. // 获取分页相关参数
  1337. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/total?id='.$cid;
  1338. $cmunionid = $this->getcmucode();
  1339. $data = curlparam($url,$cmunionid);
  1340. // 返回数据
  1341. return $data;
  1342. }
  1343. public function course_recordtheme(){
  1344. $request = request();
  1345. $cid = $request->param('cid');
  1346. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/recordtheme?cid='.$cid;
  1347. $cmunionid = $this->getcmucode();
  1348. $data = curlparam($url,$cmunionid);
  1349. $dataarr = json_decode($data, true);
  1350. View::assign('cid', $dataarr['cid']);
  1351. return View::fetch();
  1352. }
  1353. public function course_record_list(){
  1354. $request = request();
  1355. $cid = $request->param('cid');
  1356. // 获取分页相关参数
  1357. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/recordList?cid='.$cid;
  1358. $cmunionid = $this->getcmucode();
  1359. $data = curlparam($url,$cmunionid);
  1360. // 返回数据
  1361. return json_decode($data);
  1362. }
  1363. public function course_use_log(){
  1364. $request = request();
  1365. $cid = $request->param('cid');
  1366. if (!$request->isAjax()) {
  1367. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/course_use_log?cid='.$cid;
  1368. $cmunionid = $this->getcmucode();
  1369. $data = curlparam($url,$cmunionid);
  1370. $dataarr = json_decode($data, true);
  1371. View::assign('cid', $dataarr['cid']);
  1372. return View::fetch();
  1373. }
  1374. // 获取分页相关参数
  1375. $page = 1;
  1376. if($request->param('page')){
  1377. $page = $request->param('page');
  1378. }
  1379. // 获取分页相关参数
  1380. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/useLog?cid='.$cid.'&page='.$page.'&limit=10';
  1381. $cmunionid = $this->getcmucode();
  1382. $data = curlparam($url,$cmunionid);
  1383. // 返回数据
  1384. return json_decode($data);
  1385. }
  1386. public function course_appoint(){
  1387. $request = request();
  1388. $cid = $request->param('cid');
  1389. if (!$request->isAjax()) {
  1390. View::assign('cid', $cid);
  1391. return View::fetch();
  1392. }
  1393. // 获取分页相关参数
  1394. $page = 1;
  1395. if($request->param('page')){
  1396. $page = $request->param('page');
  1397. }
  1398. // 获取分页相关参数
  1399. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/appoint?cid='.$cid.'&page='.$page.'&limit=10';
  1400. $cmunionid = $this->getcmucode();
  1401. $data = curlparam($url,$cmunionid);
  1402. // 返回数据
  1403. return json_decode($data);
  1404. }
  1405. public function course_save(){
  1406. $request = request();
  1407. $data = $request->param();
  1408. $rs = $this->ossUploadBosslive('cover', ['jpg', 'png', 'bmp', 'jpeg', 'JPG', 'PNG', 'BMP', 'JPEG']);
  1409. if ($rs['code'] === 0) {
  1410. if (!empty($rs['data']['cover'])) {
  1411. $data['cover'] = $rs['data']['cover'];
  1412. }
  1413. }
  1414. $paramstr = 'title='.$data['title'].'&description='.$data['description'].'&date='.$data['date'].'&hour='.$data['hour'];
  1415. if (!empty($data['cover'])) {
  1416. $paramstr = $paramstr.'&cover='.$data['cover'];
  1417. }
  1418. $paramstr = $paramstr.'&tid='.$data['tid'].'&content='.$data['content'].'&template='.$data['template'].'&record='.$data['record'].'&open_key='.$data['open_key'];
  1419. $paramstr = $paramstr.'&key='.$data['key'].'&price='.$data['price'];
  1420. if (!empty($data['id'])) {
  1421. $paramstr = $paramstr.'&id='.$data['id'];
  1422. }
  1423. $url = 'https://'.config('app.bosslive_domain').'/saasapi/course/save?'.$paramstr;
  1424. $cmunionid = $this->getcmucode();
  1425. $data = curlparam($url,$cmunionid);
  1426. //$url = 'https://'.config('app.bosslive_domain').'/saasapi/course/save?';
  1427. //$o = "";
  1428. //foreach ( $data as $k => $v )
  1429. //{
  1430. // $o.= "$k=" . urlencode( $v ). "&" ;
  1431. //}
  1432. //$post_data = substr($o,0,-1);
  1433. //$res = curlparampost($url, $post_data);
  1434. // 返回数据
  1435. return json_decode($data);
  1436. }
  1437. private function ossUploadBosslive($path, $exts)
  1438. {
  1439. $path = str_replace('\\', '/', $path);
  1440. $filePath = [];
  1441. // 检测要上传的文件格式是否正确
  1442. foreach ($_FILES as $key => $file) {
  1443. if ($file['size'] == 0) {
  1444. continue;
  1445. }
  1446. $ext = pathinfo($file['name'], PATHINFO_EXTENSION);
  1447. if ( ! in_array($ext, $exts)) {
  1448. return [ 'code' => 1, 'msg' => '文件格式不正确' ];
  1449. }
  1450. $filePath[$key] = [ 'name' => $file['tmp_name'], 'ext' => $ext ];
  1451. }
  1452. $accessKeyId = 'LTAI4FvHHdLarUBHLpJs2YNz';
  1453. $accessKeySecret = 'UEy6HgWOvMWbNqUHxZuBzs35leJHRD';
  1454. $endpoint = 'oss-cn-hangzhou.aliyuncs.com';
  1455. $bucket = 'wzh-live';
  1456. $oss = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
  1457. $path = trim($path, '/');
  1458. $data = [];
  1459. foreach ($filePath as $key => $f) {
  1460. $fileName = date('Ymd').'/'.date('His').rand(1000, 9999).'.'.$f['ext'];
  1461. $p = $path.'/'.$fileName;
  1462. $oss->uploadFile($bucket, $p, $f['name']);
  1463. $data[$key] = $p;
  1464. }
  1465. return [ 'code' => 0, 'data' => $data ];
  1466. }
  1467. //////
  1468. public function customer_msg(){
  1469. $request = request();
  1470. $uid = $request->param('uid');
  1471. if (!$request->isAjax()) {
  1472. View::assign('uid', $uid);
  1473. return View::fetch();
  1474. }
  1475. // 获取分页相关参数
  1476. $page = 1;
  1477. if($request->param('page')){
  1478. $page = $request->param('page');
  1479. }
  1480. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/msg?uid='.$uid.'&page='.$page.'&limit=10';
  1481. if($request->param('date')){
  1482. $date = $request->param('date');
  1483. $url = $url.'&date='.$date;
  1484. }
  1485. // 获取分页相关参数
  1486. $cmunionid = $this->getcmucode();
  1487. $data = curlparam($url,$cmunionid);
  1488. // 返回数据
  1489. return json_decode($data);
  1490. }
  1491. public function customer_gift(){
  1492. $request = request();
  1493. $uid = $request->param('uid');
  1494. if (!$request->isAjax()) {
  1495. View::assign('uid', $uid);
  1496. return View::fetch();
  1497. }
  1498. // 获取分页相关参数
  1499. $page = 1;
  1500. if($request->param('page')){
  1501. $page = $request->param('page');
  1502. }
  1503. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/gift?uid='.$uid.'&page='.$page.'&limit=10';
  1504. if($request->param('date')){
  1505. $date = $request->param('date');
  1506. $url = $url.'&date='.$date;
  1507. }
  1508. // 获取分页相关参数
  1509. $cmunionid = $this->getcmucode();
  1510. $data = curlparam($url,$cmunionid);
  1511. // 返回数据
  1512. return json_decode($data);
  1513. }
  1514. public function customer_visit(){
  1515. $request = request();
  1516. $uid = $request->param('uid');
  1517. if (!$request->isAjax()) {
  1518. View::assign('uid', $uid);
  1519. return View::fetch();
  1520. }
  1521. // 获取分页相关参数
  1522. $page = 1;
  1523. if($request->param('page')){
  1524. $page = $request->param('page');
  1525. }
  1526. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/visit?uid='.$uid.'&page='.$page.'&limit=10';
  1527. if($request->param('date')){
  1528. $date = $request->param('date');
  1529. $url = $url.'&date='.$date;
  1530. }
  1531. // 获取分页相关参数
  1532. $cmunionid = $this->getcmucode();
  1533. $data = curlparam($url,$cmunionid);
  1534. // 返回数据
  1535. return json_decode($data);
  1536. }
  1537. public function customer_redbag(){
  1538. $request = request();
  1539. $uid = $request->param('uid');
  1540. if (!$request->isAjax()) {
  1541. View::assign('uid', $uid);
  1542. return View::fetch();
  1543. }
  1544. // 获取分页相关参数
  1545. $page = 1;
  1546. if($request->param('page')){
  1547. $page = $request->param('page');
  1548. }
  1549. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/redbag?uid='.$uid.'&page='.$page.'&limit=10';
  1550. if($request->param('date')){
  1551. $date = $request->param('date');
  1552. $url = $url.'&date='.$date;
  1553. }
  1554. // 获取分页相关参数
  1555. $cmunionid = $this->getcmucode();
  1556. $data = curlparam($url,$cmunionid);
  1557. // 返回数据
  1558. return json_decode($data);
  1559. }
  1560. public function customer_remark(){
  1561. $request = request();
  1562. $uid = $request->param('uid');
  1563. if (!$request->isAjax()) {
  1564. View::assign('uid', $uid);
  1565. return View::fetch();
  1566. }
  1567. // 获取分页相关参数
  1568. $page = 1;
  1569. if($request->param('page')){
  1570. $page = $request->param('page');
  1571. }
  1572. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/remark?uid='.$uid.'&page='.$page.'&limit=10';
  1573. if($request->param('date')){
  1574. $date = $request->param('date');
  1575. $url = $url.'&date='.$date;
  1576. }
  1577. // 获取分页相关参数
  1578. $cmunionid = $this->getcmucode();
  1579. $data = curlparam($url,$cmunionid);
  1580. // 返回数据
  1581. return json_decode($data);
  1582. }
  1583. public function customer_doremark(){
  1584. $request = request();
  1585. $uid = $request->param('uid');
  1586. $content = $request->param('content');
  1587. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/doremark?uid='.$uid.'&content='.$content;
  1588. // 获取分页相关参数
  1589. $cmunionid = $this->getcmucode();
  1590. $data = curlparam($url,$cmunionid);
  1591. // 返回数据
  1592. return $data;
  1593. }
  1594. public function customer_export(){
  1595. $request = request();
  1596. // 获取分页相关参数
  1597. $page = 1;
  1598. if($request->param('page')){
  1599. $page = $request->param('page');
  1600. }
  1601. $url = 'https://'.config('app.bosslive_domain').'/saasapi/customer/export?page='.$page.'&limit=15';
  1602. if($request->param('name')){
  1603. $url = $url.'&name='.$request->param('name');
  1604. }
  1605. if($request->param('nickname')){
  1606. $url = $url.'&nickname='.$request->param('nickname');
  1607. }
  1608. if($request->param('mobile')){
  1609. $url = $url.'&mobile='.$request->param('mobile');
  1610. }
  1611. if($request->param('courseId')){
  1612. $url = $url.'&courseId='.$request->param('courseId');
  1613. }
  1614. if($request->param('show')){
  1615. $url = $url.'&show='.$request->param('show');
  1616. }
  1617. // 获取分页相关参数
  1618. $cmunionid = $this->getcmucode();
  1619. $data = curlparam($url,$cmunionid);
  1620. // 返回数据
  1621. return $data;
  1622. }
  1623. public function order_edit_contact(){
  1624. $request = request();
  1625. $id = $request->param('id');
  1626. $isContact = $request->param('isContact');
  1627. $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/editContact?id='.$id.'&isContact='.$isContact;
  1628. // 获取分页相关参数
  1629. $cmunionid = $this->getcmucode();
  1630. $data = curlparam($url,$cmunionid);
  1631. // 返回数据
  1632. return $data;
  1633. }
  1634. public function order_contact(){
  1635. $request = request();
  1636. $uid = $request->param('uid');
  1637. $gid = $request->param('gid');
  1638. $cid = $request->param('cid');
  1639. $name = $request->param('name');
  1640. $mobile = $request->param('mobile');
  1641. $isContact = $request->param('isContact');
  1642. $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/contact?uid='.$uid.'&isContact='.$isContact;
  1643. $url = $url.'&gid='.$gid;
  1644. $url = $url.'&cid='.$cid;
  1645. $url = $url.'&name='.$name;
  1646. $url = $url.'&mobile='.$mobile;
  1647. // 获取分页相关参数
  1648. $cmunionid = $this->getcmucode();
  1649. $data = curlparam($url,$cmunionid);
  1650. // 返回数据
  1651. return $data;
  1652. }
  1653. public function order_export(){
  1654. $request = request();
  1655. // 获取分页相关参数
  1656. $page = 1;
  1657. if($request->param('page')){
  1658. $page = $request->param('page');
  1659. }
  1660. $url = 'https://'.config('app.bosslive_domain').'/saasapi/order/export?page='.$page.'&limit=15';
  1661. if($request->param('name')){
  1662. $url = $url.'&name='.$request->param('name');
  1663. }
  1664. if($request->param('mobile')){
  1665. $url = $url.'&mobile='.$request->param('mobile');
  1666. }
  1667. if($request->param('orderNo')){
  1668. $url = $url.'&orderNo='.$request->param('orderNo');
  1669. }
  1670. if($request->param('course')){
  1671. $url = $url.'&course='.$request->param('course');
  1672. }
  1673. if($request->param('contact')){
  1674. $url = $url.'&contact='.$request->param('contact');
  1675. }
  1676. // 获取分页相关参数
  1677. $cmunionid = $this->getcmucode();
  1678. $data = curlparam($url,$cmunionid);
  1679. // 返回数据
  1680. return $data;
  1681. }
  1682. public function present_enter_shop(){
  1683. $request = request();
  1684. $id = $request->param('id');
  1685. $url = 'https://'.config('app.bosslive_domain').'/saasapi/present/enterShop?id='.$id;
  1686. // 获取分页相关参数
  1687. $cmunionid = $this->getcmucode();
  1688. $data = curlparam($url,$cmunionid);
  1689. // 返回数据
  1690. return $data;
  1691. }
  1692. public function goods_edit_sale_num(){
  1693. $request = request();
  1694. $id = $request->param('id');
  1695. $val = $request->param('val');
  1696. $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/edit_sale_num?id='.$id.'&val='.$val;
  1697. $cmunionid = $this->getcmucode();
  1698. $data = curlparam($url,$cmunionid);
  1699. // 返回数据
  1700. return $data;
  1701. }
  1702. public function goods_edit_queue_num(){
  1703. $request = request();
  1704. $id = $request->param('id');
  1705. $queue = $request->param('queue');
  1706. $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/edit_queue_num?id='.$id.'&queue='.$queue;
  1707. $cmunionid = $this->getcmucode();
  1708. $data = curlparam($url,$cmunionid);
  1709. // 返回数据
  1710. return $data;
  1711. }
  1712. public function goods_editStatus(){
  1713. $request = request();
  1714. $id = $request->param('id');
  1715. $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/editStatus?id='.$id;
  1716. $cmunionid = $this->getcmucode();
  1717. $data = curlparam($url,$cmunionid);
  1718. // 返回数据
  1719. return $data;
  1720. }
  1721. public function goods_del(){
  1722. $request = request();
  1723. $id = $request->param('id');
  1724. $url = 'https://'.config('app.bosslive_domain').'/saasapi/goods/del?id='.$id;
  1725. $cmunionid = $this->getcmucode();
  1726. $data = curlparam($url,$cmunionid);
  1727. // 返回数据
  1728. return $data;
  1729. }
  1730. }