AdminbackoneeightController.class.php 209 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013
  1. <?php
  2. namespace Admin\Controller;
  3. use Think\Controller;
  4. class AdminbackoneeightController extends Controller
  5. {
  6. /**
  7. * 后台收入统计 水友
  8. *
  9. * @param $templateid []
  10. * @return $type 消息类型
  11. */
  12. public function shouye_gailan()
  13. {
  14. ini_set('memory_limit', '556M');
  15. header('Content-Type:text/json;charset=utf-8');
  16. header('Access-Control-Allow-Origin:*');
  17. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  18. header('Access-Control-Allow-Methods:POST');
  19. header('Access-Control-Expose-Headers:*');
  20. $fk_liaotian_biao = M("user_info");
  21. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  22. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  23. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  24. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  25. $san_start_time = strtotime(date("Y-m-d", strtotime("-3 day")) . "00:00:00");
  26. $san_end_time = time();
  27. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  28. $zhou_end_time = time();
  29. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  30. $yue_end_time = time();
  31. $jl_start_time = '0';
  32. $jl_end_time = '9999999999999999999999';
  33. //注册
  34. $zc_jilei = 0;
  35. $zc_jinri = 0;
  36. $zc_zuori = 0;
  37. $zc_sanri = 0;
  38. $zc_yizhou = 0;
  39. $zc_yiyue = 0;
  40. //付费人数
  41. $ffp_jilei = 0;
  42. $ffp_jinri = 0;
  43. $ffp_zuori = 0;
  44. $ffp_sanri = 0;
  45. $ffp_yizhou = 0;
  46. $ffp_yiyue = 0;
  47. //付费金额
  48. $ffm_jilei = 0;
  49. $ffm_jinri = 0;
  50. $ffm_zuori = 0;
  51. $ffm_sanri = 0;
  52. $ffm_yizhou = 0;
  53. $ffm_yiyue = 0;
  54. $zhuce_list = M("user_info")->field("add_time")->select();
  55. foreach ($zhuce_list as $key => $value) {
  56. # code...
  57. $user_zhuce_time = $value['add_time'];
  58. if ($jinri_end_time > $user_zhuce_time and $user_zhuce_time > $jinri_start_time) {
  59. $zc_jilei++;
  60. $zc_jinri++;
  61. $zc_sanri++;
  62. $zc_yizhou++;
  63. $zc_yiyue++;
  64. } elseif ($zuo_end_time > $user_zhuce_time and $user_zhuce_time > $zuo_start_time) {
  65. $zc_jilei++;
  66. $zc_zuori++;
  67. $zc_yiyue++;
  68. } elseif ($san_end_time > $user_zhuce_time and $user_zhuce_time > $san_start_time) {
  69. $zc_jilei++;
  70. $zc_sanri++;
  71. $zc_yiyue++;
  72. } elseif ($zhou_end_time > $user_zhuce_time and $user_zhuce_time > $zhou_start_time) {
  73. $zc_jilei++;
  74. $zc_yizhou++;
  75. $zc_yiyue++;
  76. } elseif ($yue_end_time > $user_zhuce_time and $user_zhuce_time > $yue_start_time) {
  77. $zc_jilei++;
  78. $zc_yiyue++;
  79. } elseif ($user_zhuce_time < $yue_start_time) {
  80. $zc_jilei++;
  81. }
  82. }
  83. //付费人数 和钱数
  84. $user_list = M("pay_test")->field("uid,pay_time,amount")->where("order_type='已支付'")->select();
  85. foreach ($user_list as $key1 => $value1) {
  86. $user_ff_time = $value1['pay_time'];
  87. $fufei_jine = $value1['amount'];
  88. if ($jinri_end_time > $user_ff_time and $user_ff_time > $jinri_start_time) {
  89. $ffm_jilei += $fufei_jine;
  90. $ffm_jinri += $fufei_jine;
  91. $ffm_sanri += $fufei_jine;
  92. $ffm_yizhou += $fufei_jine;
  93. $ffm_yiyue += $fufei_jine;
  94. } elseif ($zuo_end_time > $user_ff_time and $user_ff_time > $zuo_start_time) {
  95. $ffm_yiyue += $fufei_jine;
  96. $ffm_jilei += $fufei_jine;
  97. $ffm_zuori += $fufei_jine;
  98. $ffm_yizhou += $fufei_jine;
  99. } elseif ($san_end_time > $user_ff_time and $user_ff_time > $san_start_time) {
  100. $ffm_yiyue += $fufei_jine;
  101. $ffm_jilei += $fufei_jine;
  102. $ffm_sanri += $fufei_jine;
  103. $ffm_yizhou += $fufei_jine;
  104. } elseif ($zhou_end_time > $user_ff_time and $user_ff_time > $zhou_start_time) {
  105. $ffm_yiyue += $fufei_jine;
  106. $ffm_jilei += $fufei_jine;
  107. $ffm_yizhou += $fufei_jine;
  108. } elseif ($yue_end_time > $user_ff_time and $user_ff_time > $yue_start_time) {
  109. $ffm_jilei += $fufei_jine;
  110. $ffm_yiyue += $fufei_jine;
  111. } else {
  112. //} else ($user_zhuce_time < $yue_start_time) {
  113. $ffm_jilei += $fufei_jine;
  114. }
  115. }
  116. //今日
  117. $todaytime = strtotime(date("Y-m-d", time()) . "00:00:00");
  118. //三日
  119. $threedaytime = strtotime(date("Y-m-d", strtotime("-3 day")) . "00:00:00");
  120. //周
  121. $weekdaytime = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  122. //14日
  123. $fourteendaytime = strtotime(date("Y-m-d", strtotime("-14 day")) . "00:00:00");
  124. $yueday_time = strtotime(date("Y-m-d", strtotime("-30 day")) . "00:00:00");
  125. $renshu_jin = M("pay_test")->where("pay_time>='$todaytime'")->field("uid")->group("uid")->select();
  126. $renshu_zuo = M("pay_test")->where("pay_time>='$zuo_start_time' and pay_time<='$zuo_end_time'")->field("uid")->group("uid")->select();
  127. $renshu_san = M("pay_test")->where("pay_time>='$threedaytime'")->field("uid")->group("uid")->select();;
  128. $renshu_zhou = M("pay_test")->where("pay_time>='$weekdaytime'")->field("uid")->group("uid")->select();
  129. $renshu_yue = M("pay_test")->where("pay_time>='$yueday_time'")->field("uid")->group("uid")->select();
  130. $renshu_jilei = M("pay_test")->field("uid")->group("uid")->select();
  131. $huoyue_jin = M("huoyue_list")->where("time>='$jinri_start_time' and time<='$jinri_end_time'")->field("uid")->group("uid")->select();
  132. $huoyue_zuo = M("huoyue_list")->where("time>='$zuo_start_time' and time<='$zuo_end_time'")->field("uid")->group("uid")->select();
  133. $huoyue_san = M("huoyue_list")->where("time>='$san_start_time' and time<='$san_end_time' ")->field("uid")->group("uid")->select();;
  134. $huoyue_zhou = M("huoyue_list")->where("time>='$zhou_start_time' and time<='$zhou_end_time'")->field("uid")->group("uid")->select();
  135. $huoyue_yue = M("huoyue_list")->where("time>='$yue_start_time' and time<='$yue_end_time'")->field("uid")->group("uid")->select();
  136. $huoyue_jilei = M("huoyue_list")->field("uid")->group("uid")->select();
  137. $yizhoulist['jinri'] = $zc_jinri;
  138. $yizhoulist['zuori'] = $zc_zuori;
  139. $yizhoulist['sanri'] = $zc_sanri;
  140. $yizhoulist['zhou'] = $zc_yizhou;
  141. $yizhoulist['yue'] = $zc_yiyue;
  142. $yizhoulist['jilei'] = $zc_jilei;
  143. $fufei_num['jinri_num'] = count($renshu_jin);
  144. $fufei_num['zuori_num'] = count($renshu_zuo);
  145. $fufei_num['sanri_num'] = count($renshu_san);
  146. $fufei_num['zhou_num'] = count($renshu_zhou);
  147. $fufei_num['yue_num'] = count($renshu_yue);
  148. $fufei_num['jilei_num'] = count($renshu_jilei);
  149. $fufei_number['jinri_people'] = $ffm_jinri;
  150. $fufei_number['zuori_people'] = $ffm_zuori;
  151. $fufei_number['sanri_people'] = $ffm_sanri;
  152. $fufei_number['zhou_people'] = $ffm_yizhou;
  153. $fufei_number['yue_people'] = $ffm_yiyue;
  154. $fufei_number['jilei_people'] = $ffm_jilei;
  155. $huoyue_num['jinriAAA_num'] = count($huoyue_jin);
  156. $huoyue_num['zuoriAAA_num'] = count($huoyue_zuo);
  157. $huoyue_num['sanriAAA_num'] = count($huoyue_san);
  158. $huoyue_num['zhouAAA_num'] = count($huoyue_zhou);
  159. $huoyue_num['yueAAA_num'] = count($huoyue_yue);
  160. $huoyue_num['jileiAAA_num'] = count($huoyue_jilei);
  161. $shuzu_list = array($yizhoulist, $fufei_number, $fufei_num, $huoyue_num);
  162. $data['code'] = '200';
  163. $data['status'] = '1';
  164. $data['message'] = '';
  165. $data['data'] = $shuzu_list;
  166. echo json_encode($data);
  167. }
  168. public function slUserStatistics()
  169. {
  170. // 指定允许其他域名访问
  171. // header('Access-Control-Allow-Origin:*');
  172. // 响应类型
  173. header('Access-Control-Allow-Methods:POST');
  174. // 响应头设置
  175. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  176. if (!empty($_POST)) {
  177. $token = $_POST['token']; //b8e3bb6ef8747d7
  178. if ($token != 'b8e3bb6ef8747d7') {
  179. $data['code'] = '203';
  180. $data['msg'] = 'token错误';
  181. echo json_encode($data);
  182. die;
  183. }
  184. //今日
  185. $todaytime = strtotime(date("Y-m-d", time()) . "00:00:00");
  186. //三日
  187. $threedaytime = strtotime(date("Y-m-d", strtotime("-3 day")) . "00:00:00");
  188. //周
  189. $weekdaytime = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  190. //14日
  191. $fourteendaytime = strtotime(date("Y-m-d", strtotime("-14 day")) . "00:00:00");
  192. /**
  193. * 注册人数统计
  194. */
  195. //累计新增注册
  196. $arr['totaluser'] = M("slgj_user")->count();
  197. //今日新增注册
  198. $arr['todayuser'] = M("slgj_user")->where("registertime>='$todaytime'")->count();
  199. //3日新增注册
  200. $arr['threedayuser'] = M("slgj_user")->where("registertime>='$threedaytime'")->count();
  201. //周新增注册
  202. $arr['weekuser'] = M("slgj_user")->where("registertime>='$weekdaytime'")->count();
  203. //14日新增注册
  204. $arr['fourteenuser'] = M("slgj_user")->where("registertime>='$fourteendaytime'")->count();
  205. /**
  206. * 登录人数统计
  207. */
  208. //今日登录人数
  209. $arr['todayloginuser'] = count(M("slgj_user_sessid")->where("time>='$todaytime' and uid!=0")->group("uid")->getField("uid", true));
  210. //3日登录人数
  211. $arr['threedayloginuser'] = count(M("slgj_user_sessid")->where("time>='$threedaytime' and uid!=0")->group("uid")->getField("uid", true));
  212. //周登录人数
  213. $arr['weekloginuser'] = count(M("slgj_user_sessid")->where("time>='$weekdaytime' and uid!=0")->group("uid")->getField("uid", true));
  214. //14日登录人数
  215. $arr['fourteenloginuser'] = count(M("slgj_user_sessid")->where("time>='$fourteendaytime' and uid!=0")->group("uid")->getField("uid", true));
  216. /**
  217. * 留存人数统计
  218. */
  219. //3日留存
  220. $arr['threedaykeep'] = "0";
  221. //7日留存
  222. $arr['weekdaykeep'] = "0";
  223. //14日留存
  224. $arr['fourteenkeep'] = "0";
  225. $data['code'] = '200';
  226. $data['msg'] = '请求成功';
  227. $data['data'] = $arr;
  228. echo json_encode($data);
  229. } else {
  230. $data['code'] = '202';
  231. $data['msg'] = '参数不正确';
  232. echo json_encode($data);
  233. die;
  234. }
  235. }
  236. //sl后台用户统计
  237. public function slUserInfo()
  238. {
  239. // 指定允许其他域名访问
  240. // header('Access-Control-Allow-Origin:*');
  241. // 响应类型
  242. header('Access-Control-Allow-Methods:POST');
  243. // 响应头设置
  244. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  245. if (!empty($_POST)) {
  246. $token = $_POST['token']; //b8e3bb6ef8747d7
  247. if ($token != 'b8e3bb6ef8747d7') {
  248. $data['code'] = '203';
  249. $data['msg'] = 'token错误';
  250. echo json_encode($data);
  251. die;
  252. }
  253. $page = $_POST['page'];
  254. $size = $_POST['size'];
  255. $arr = M("slgj_user")->field("id,account,registertime,lastlogintime")->page($page, $size)->order("id desc")->select();
  256. if ($arr) {
  257. $total = M("slgj_user")->count();
  258. foreach ($arr as $k => $v) {
  259. $arr[$k]['registertime'] = date("m.d H:i", $v['registertime']);
  260. $lastlogintime = M("slgj_user_sessid")->where(array("uid" => $v['id']))->order("id desc")->find();
  261. if ($lastlogintime) {
  262. $arr[$k]['lastlogintime'] = date("m.d H:i", $lastlogintime['time']);
  263. } else {
  264. $arr[$k]['lastlogintime'] = date("m.d H:i", $v['lastlogintime']);
  265. }
  266. }
  267. $data['code'] = '200';
  268. $data['msg'] = '请求成功';
  269. $data['data'] = $arr;
  270. $data['total'] = $total;
  271. echo json_encode($data);
  272. } else {
  273. $data['code'] = '201';
  274. $data['msg'] = '暂无数据';
  275. $data['data'] = array();
  276. $data['total'] = "0";
  277. echo json_encode($data);
  278. }
  279. } else {
  280. $data['code'] = '202';
  281. $data['msg'] = '参数不正确';
  282. echo json_encode($data);
  283. die;
  284. }
  285. }
  286. //sl后台用户信息
  287. public function slUserFeedback()
  288. {
  289. // 指定允许其他域名访问
  290. // header('Access-Control-Allow-Origin:*');
  291. // 响应类型
  292. header('Access-Control-Allow-Methods:POST');
  293. // 响应头设置
  294. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  295. if (!empty($_POST)) {
  296. $token = $_POST['token']; //b8e3bb6ef8747d7
  297. if ($token != 'b8e3bb6ef8747d7') {
  298. $data['code'] = '203';
  299. $data['msg'] = 'token错误';
  300. echo json_encode($data);
  301. die;
  302. }
  303. $page = $_POST['page'];
  304. $size = $_POST['size'];
  305. $arr = M("slgj_user_feedback")->page($page, $size)->order("id desc")->select();
  306. if ($arr) {
  307. $total = M("slgj_user_feedback")->count();
  308. foreach ($arr as $k => $v) {
  309. $arr[$k]['account'] = M("slgj_user")->where(array("uid" => $v['uid']))->find()['account'];
  310. $arr[$k]['time'] = date("m.d H:i", $v['time']);
  311. if ($v['reply_time'] == "") {
  312. $arr[$k]['is_reply'] = "回复";
  313. } else {
  314. $arr[$k]['is_reply'] = "已回复";
  315. }
  316. }
  317. $data['code'] = '200';
  318. $data['msg'] = '请求成功';
  319. $data['data'] = $arr;
  320. $data['total'] = $total;
  321. echo json_encode($data);
  322. } else {
  323. $data['code'] = '201';
  324. $data['msg'] = '暂无数据';
  325. $data['data'] = array();
  326. $data['total'] = "0";
  327. echo json_encode($data);
  328. }
  329. } else {
  330. $data['code'] = '202';
  331. $data['msg'] = '参数不正确';
  332. echo json_encode($data);
  333. die;
  334. }
  335. }
  336. //视频列表和视频详情广告展示
  337. public function advertShowStart()
  338. {
  339. // 指定允许其他域名访问
  340. header('Access-Control-Allow-Origin:*');
  341. // 响应类型
  342. header('Access-Control-Allow-Methods:POST');
  343. // 响应头设置
  344. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  345. if (!empty($_POST)) {
  346. $token = $_POST['token']; //b8e3bb6ef8747d7
  347. if ($token != 'b8e3bb6ef8747d7') {
  348. $data['code'] = '203';
  349. $data['msg'] = 'token错误';
  350. echo json_encode($data);
  351. die;
  352. }
  353. $page = $_POST['page'];
  354. $size = $_POST['size'];
  355. $arr = M("slgj_advert_list")->page($page, $size)->where("type='片头广告'")->select();
  356. if ($arr) {
  357. $total = M("slgj_advert_list")->where("type='片头广告'")->count();
  358. $data['code'] = '200';
  359. $data['msg'] = '请求成功';
  360. $data['data'] = $arr;
  361. $data['total'] = $total;
  362. echo json_encode($data);
  363. } else {
  364. $data['code'] = '201';
  365. $data['msg'] = '暂无数据';
  366. $data['data'] = array();
  367. $data['total'] = "0";
  368. echo json_encode($data);
  369. }
  370. } else {
  371. $data['code'] = '202';
  372. $data['msg'] = '参数不正确';
  373. echo json_encode($data);
  374. die;
  375. }
  376. }
  377. //视频开头广告展示
  378. public function videoAdvertAdd()
  379. {
  380. // 指定允许其他域名访问
  381. // header('Access-Control-Allow-Origin:*');
  382. // 响应类型
  383. header('Access-Control-Allow-Methods:POST');
  384. // 响应头设置
  385. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  386. // echo PHP_EOL.'22';
  387. if (!empty($_POST)) {
  388. $token = $_POST['token']; //b8e3bb6ef8747d7
  389. if ($token != 'b8e3bb6ef8747d7') {
  390. $data['code'] = '203';
  391. $data['msg'] = 'token错误';
  392. echo json_encode($data);
  393. die;
  394. }
  395. $arr['type'] = $type = $_POST['type']; //广告类型 视频列表和视频详情/视频开头
  396. $count = M("slgj_advert_list")->where("type='$type'")->count();
  397. if ($count == "0") {
  398. $arr['number'] = "00" . ($count + 1);
  399. } else {
  400. $numbers = M("slgj_advert_list")->where("type='$type'")->order("number desc")->find()['number'];
  401. $numb = $numbers + 1;
  402. if ($numb > 0 and $numb <= 9) {
  403. $arr['number'] = "00" . $numb;
  404. } elseif ($numb > 9 and $numb <= 99) {
  405. $arr['number'] = "0" . $numb;
  406. } else {
  407. $arr['number'] = $numb;
  408. }
  409. }
  410. $arr['jump_link'] = $_POST['jump_link']; //跳转链接
  411. $arr['content'] = $_POST['content']; //备注
  412. $img = $_FILES['img'];
  413. $upload = new \Think\Upload(); // 实例化上传类
  414. $upload->maxSize = 0; //设置附件上传大小
  415. $upload->exts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型
  416. $upload->rootPath = './Public/'; // 设置附件上传根目录
  417. $upload->savePath = 'backroundiMg/'; // 设置附件上传附目录
  418. $path = "https://www.aa9169.com/Public/";
  419. $info = $upload->uploadOne($img); // 上传单个文件
  420. if (!$info) {
  421. // 上传错误提示错误信息
  422. $this->error($upload->getError());
  423. } else {
  424. $imgs = $path . $info['savepath'] . $info['savename'];
  425. $arr['img'] = $imgs;
  426. }
  427. $ret = M("slgj_advert_list")->add($arr);
  428. if ($ret) {
  429. $data['code'] = '200';
  430. $data['msg'] = '请求成功';
  431. echo json_encode($data);
  432. } else {
  433. $data['code'] = '201';
  434. $data['msg'] = '请求失败';
  435. echo json_encode($data);
  436. }
  437. } else {
  438. $data['code'] = '202';
  439. $data['msg'] = '参数不正确';
  440. echo json_encode($data);
  441. die;
  442. }
  443. }
  444. /**
  445. * 版本:
  446. * 新增/更新:
  447. * 简述:
  448. * @param $templateid []
  449. * @return $type 消息类型
  450. */
  451. public function save_adv_yn_browse(){
  452. header('Content-Type:text/json;charset=utf-8');
  453. header('Access-Control-Allow-Origin:*');
  454. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  455. header('Access-Control-Allow-Methods:POST');
  456. header('Access-Control-Expose-Headers:*');
  457. if (!empty($_POST)){
  458. $id = $_POST['adv_id'];
  459. $yn = $_POST['yn'];
  460. switch ($yn) {
  461. case 'y':
  462. $arr['yn_browse'] = 1;
  463. break;
  464. case 'n':
  465. $arr['yn_browse'] = 0;
  466. break;
  467. default:
  468. $arr['yn_browse'] = 1;
  469. }
  470. $ret = M("slgj_advert_list")->where("id='$id'")->save($arr);
  471. if ($ret){
  472. $data['message'] = 'ok';
  473. echo json_encode($data);
  474. }else{
  475. $data['message'] = 'error';
  476. echo json_encode($data);
  477. }
  478. }else{
  479. echo $this->returnData();
  480. }
  481. }
  482. /**
  483. * 版本:
  484. * 新增/更新:
  485. * 简述:
  486. * @param $templateid []
  487. * @return $type 消息类型
  488. */
  489. public function error_video_list_show(){
  490. header('Content-Type:text/json;charset=utf-8');
  491. header('Access-Control-Allow-Origin:*');
  492. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  493. header('Access-Control-Allow-Methods:POST');
  494. header('Access-Control-Expose-Headers:*');
  495. if (!empty($_POST)){
  496. $token = $_POST['token']; //b8e3bb6ef8747d7
  497. if ($token != 'b8e3bb6ef8747d7') {
  498. $data['code'] = '203';
  499. $data['msg'] = 'token错误';
  500. echo json_encode($data);
  501. die;
  502. }
  503. $page = $_POST['page'];
  504. $page_one = ($page - 1) * 50;
  505. $error_list_video = M("error_videos_list")->order("id desc")->LIMIT($page_one, 50)->select();
  506. if (!empty($error_list_video)){
  507. $data['code'] = '200';
  508. $data['status'] = '1';
  509. $data['message'] = 'ok';
  510. $data['all_count'] = M("error_videos_list")->where("id>0")->count();
  511. $data['error_count'] = M("error_videos_list")->where("type=0")->count();
  512. $data['data'] = $error_list_video;
  513. echo json_encode($data);
  514. }else{
  515. $data['message'] = 'error';
  516. echo json_encode($data);
  517. }
  518. }else{
  519. echo $this->returnData();
  520. }
  521. }
  522. /**
  523. * 版本:
  524. * 新增/更新:
  525. * 简述:
  526. * @param $templateid []
  527. * @return $type 消息类型
  528. */
  529. public function save_error_video_type(){
  530. header('Content-Type:text/json;charset=utf-8');
  531. header('Access-Control-Allow-Origin:*');
  532. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  533. header('Access-Control-Allow-Methods:POST');
  534. header('Access-Control-Expose-Headers:*');
  535. if (!empty($_POST)){
  536. $eid = $_POST['id'];
  537. $vid = $_POST['v_id'];
  538. $error_type['type'] =1;
  539. $yn_save = M("error_videos_list")->where("v_id=$vid")->save($error_type);
  540. if ($yn_save){
  541. $data['message'] = 'ok';
  542. echo json_encode($data);
  543. }else{
  544. $data['message'] = 'error';
  545. echo json_encode($data);
  546. }
  547. }else{
  548. echo $this->returnData();
  549. }
  550. }
  551. /**
  552. * 版本:
  553. * 新增/更新:
  554. * 简述:广告数量
  555. * @param $templateid []
  556. * @return $type 消息类型
  557. */
  558. public function adv_count_show(){
  559. header('Content-Type:text/json;charset=utf-8');
  560. header('Access-Control-Allow-Origin:*');
  561. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  562. header('Access-Control-Allow-Methods:POST');
  563. header('Access-Control-Expose-Headers:*');
  564. if (!empty($_POST)){
  565. $token = $_POST['token']; //b8e3bb6ef8747d7
  566. if ($token != 'b8e3bb6ef8747d7') {
  567. $data['code'] = '203';
  568. $data['msg'] = 'token错误';
  569. echo json_encode($data);
  570. die;
  571. }
  572. $start_adv = M("slgj_advert_list")->where("type='片头广告'")->field('id')->count();
  573. $videolist_adv = M("slgj_advert_list")->where("type='视频列表广告'")->field('id')->count();
  574. $adv_list = array(
  575. 'start_adv' =>$start_adv,
  576. 'videolist_adv' =>$videolist_adv
  577. );
  578. $data['code'] = '200';
  579. $data['status'] = '1';
  580. $data['message'] = 'ok';
  581. $data['data'] = $adv_list;
  582. echo json_encode($data);
  583. }else{
  584. echo $this->returnData();
  585. }
  586. }
  587. //广告添加
  588. public function advertShowDetailOne()
  589. {
  590. // 指定允许其他域名访问
  591. header('Access-Control-Allow-Origin:*');
  592. // 响应类型
  593. header('Access-Control-Allow-Methods:POST');
  594. // 响应头设置
  595. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  596. if (!empty($_POST)) {
  597. $token = $_POST['token']; //b8e3bb6ef8747d7
  598. if ($token != 'b8e3bb6ef8747d7') {
  599. $data['code'] = '203';
  600. $data['msg'] = 'token错误';
  601. echo json_encode($data);
  602. die;
  603. }
  604. $id = $_POST['advert_id'];
  605. $arr = M("slgj_advert_list")->where("id='$id'")->find();
  606. if ($arr) {
  607. $data['code'] = '200';
  608. $data['msg'] = '请求成功';
  609. $data['data'] = $arr;
  610. echo json_encode($data);
  611. } else {
  612. $data['code'] = '201';
  613. $data['msg'] = '暂无数据';
  614. $data['data'] = array();
  615. echo json_encode($data);
  616. }
  617. } else {
  618. $data['code'] = '202';
  619. $data['msg'] = '参数不正确';
  620. echo json_encode($data);
  621. die;
  622. }
  623. }
  624. //编辑广告时展示单条数据
  625. //修改广告
  626. public function videoAdvertDetail()
  627. {
  628. // 指定允许其他域名访问
  629. // header('Access-Control-Allow-Origin:*');
  630. // 响应类型
  631. header('Access-Control-Allow-Methods:POST');
  632. // 响应头设置
  633. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  634. if (!empty($_POST)) {
  635. $token = $_POST['token']; //b8e3bb6ef8747d7
  636. if ($token != 'b8e3bb6ef8747d7') {
  637. $data['code'] = '203';
  638. $data['msg'] = 'token错误';
  639. echo json_encode($data);
  640. die;
  641. }
  642. $id = $_POST['advert_id'];
  643. $arr['jump_link'] = $_POST['jump_link']; //跳转链接
  644. $arr['content'] = $_POST['content']; //备注
  645. $oldimg = M("slgj_advert_list")->where("id='$id'")->find()['img'];
  646. $img = $_FILES['img'];
  647. if ($img == '' || $img == "undefined") {
  648. $arr['img'] = $oldimg;
  649. } else {
  650. $upload = new \Think\Upload(); // 实例化上传类
  651. $upload->maxSize = 0; //设置附件上传大小
  652. $upload->exts = array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型
  653. $upload->rootPath = './Public/'; // 设置附件上传根目录
  654. $upload->savePath = 'backroundiMg/'; // 设置附件上传附目录
  655. $path = "https://www.aa9169.com/Public/";
  656. $info = $upload->uploadOne($img); // 上传单个文件
  657. if (!$info) {
  658. // 上传错误提示错误信息
  659. $this->error($upload->getError());
  660. } else {
  661. $imgs = $path . $info['savepath'] . $info['savename'];
  662. $arr['img'] = $imgs;
  663. }
  664. }
  665. $ret = M("slgj_advert_list")->where("id='$id'")->save($arr);
  666. if ($ret) {
  667. // $this->unlink($oldimg);
  668. $data['code'] = '200';
  669. $data['msg'] = '请求成功';
  670. echo json_encode($data);
  671. } else {
  672. $data['code'] = '201';
  673. $data['msg'] = '请求失败';
  674. echo json_encode($data);
  675. }
  676. } else {
  677. $data['code'] = '202';
  678. $data['msg'] = '参数不正确';
  679. echo json_encode($data);
  680. die;
  681. }
  682. }
  683. //视频广告编辑
  684. public function videoAdvertDelete()
  685. {
  686. // 指定允许其他域名访问
  687. // header('Access-Control-Allow-Origin:*');
  688. // 响应类型
  689. header('Access-Control-Allow-Methods:POST');
  690. // 响应头设置
  691. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  692. if (!empty($_POST)) {
  693. $token = $_POST['token']; //b8e3bb6ef8747d7
  694. if ($token != 'b8e3bb6ef8747d7') {
  695. $data['code'] = '203';
  696. $data['msg'] = 'token错误';
  697. echo json_encode($data);
  698. die;
  699. }
  700. $id = $_POST['advert_id'];
  701. $oldimg = M("slgj_advert_list")->where("id='$id'")->find()['img'];
  702. $ret = M("slgj_advert_list")->where("id='$id'")->delete();
  703. if ($ret) {
  704. $this->unlink($oldimg);
  705. $data['code'] = '200';
  706. $data['msg'] = '请求成功';
  707. echo json_encode($data);
  708. } else {
  709. $data['code'] = '201';
  710. $data['msg'] = '请求失败';
  711. echo json_encode($data);
  712. }
  713. } else {
  714. $data['code'] = '202';
  715. $data['msg'] = '参数不正确';
  716. echo json_encode($data);
  717. die;
  718. }
  719. }
  720. //删除服务器上的图片
  721. public function unlink($img)
  722. {
  723. $str = substr($img, 23);
  724. $filename = "./" . $str;
  725. @unlink($filename);
  726. }
  727. //视频广告删除
  728. public function backSetDetailOne()
  729. {
  730. // 指定允许其他域名访问
  731. // header('Access-Control-Allow-Origin:*');
  732. // 响应类型
  733. header('Access-Control-Allow-Methods:POST');
  734. // 响应头设置
  735. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  736. if (!empty($_POST)) {
  737. $token = $_POST['token']; //b8e3bb6ef8747d7
  738. if ($token != 'b8e3bb6ef8747d7') {
  739. $data['code'] = '203';
  740. $data['msg'] = 'token错误';
  741. echo json_encode($data);
  742. die;
  743. }
  744. $id = $_POST['back_id'];
  745. $arr = M("slgj_backgroud_setting")->where("id='$id'")->find();
  746. if ($arr) {
  747. $data['code'] = '200';
  748. $data['msg'] = '请求成功';
  749. $data['data'] = $arr;
  750. echo json_encode($data);
  751. } else {
  752. $data['code'] = '201';
  753. $data['msg'] = '暂无数据';
  754. $data['data'] = array();
  755. echo json_encode($data);
  756. }
  757. } else {
  758. $data['code'] = '202';
  759. $data['msg'] = '参数不正确';
  760. echo json_encode($data);
  761. die;
  762. }
  763. }
  764. //后台设置展示单条数据
  765. public function backSetShowAll()
  766. {
  767. // 指定允许其他域名访问
  768. // header('Access-Control-Allow-Origin:*');
  769. // 响应类型
  770. header('Access-Control-Allow-Methods:POST');
  771. // 响应头设置
  772. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  773. if (!empty($_POST)) {
  774. $token = $_POST['token']; //b8e3bb6ef8747d7
  775. if ($token != 'b8e3bb6ef8747d7') {
  776. $data['code'] = '203';
  777. $data['msg'] = 'token错误';
  778. echo json_encode($data);
  779. die;
  780. }
  781. $arr = M("slgj_backgroud_setting")->select();
  782. if ($arr) {
  783. $data['code'] = '200';
  784. $data['msg'] = '请求成功';
  785. $data['data'] = $arr;
  786. echo json_encode($data);
  787. } else {
  788. $data['code'] = '201';
  789. $data['msg'] = '暂无数据';
  790. $data['data'] = array();
  791. echo json_encode($data);
  792. }
  793. } else {
  794. $data['code'] = '202';
  795. $data['msg'] = '参数不正确';
  796. echo json_encode($data);
  797. die;
  798. }
  799. }
  800. //后台设置展示所有数据
  801. public function backgroundSettingDetail()
  802. {
  803. // 指定允许其他域名访问
  804. // header('Access-Control-Allow-Origin:*');
  805. // 响应类型
  806. header('Access-Control-Allow-Methods:POST');
  807. // 响应头设置
  808. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  809. if (!empty($_POST)) {
  810. $token = $_POST['token']; //b8e3bb6ef8747d7
  811. if ($token != 'b8e3bb6ef8747d7') {
  812. $data['code'] = '203';
  813. $data['msg'] = 'token错误';
  814. echo json_encode($data);
  815. die;
  816. }
  817. $id = $_POST['back_id'];
  818. $arr['url_type'] = $_POST['url_type']; //网址类型
  819. $arr['jump_link'] = $_POST['jump_link']; //跳转链接
  820. $ret = M("slgj_backgroud_setting")->where("id='$id'")->save($arr);
  821. if ($ret) {
  822. $data['code'] = '200';
  823. $data['msg'] = '请求成功';
  824. echo json_encode($data);
  825. } else {
  826. $data['code'] = '201';
  827. $data['msg'] = '请求失败';
  828. echo json_encode($data);
  829. }
  830. } else {
  831. $data['code'] = '202';
  832. $data['msg'] = '参数不正确';
  833. echo json_encode($data);
  834. die;
  835. }
  836. }
  837. //后台设置编辑
  838. /**
  839. * 测试功能
  840. *
  841. * @param $templateid []
  842. * @return $type 消息类型
  843. */
  844. public function thirdpartylink()
  845. {
  846. // 指定允许其他域名访问
  847. header('Access-Control-Allow-Origin:*');
  848. // 响应类型
  849. header('Access-Control-Allow-Methods:POST');
  850. // 响应头设置
  851. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  852. if (!empty($_POST)) {
  853. $iid = $_POST['id'];
  854. $wula = M("three_url")->where("id=$iid")->field("id", true)->select();
  855. $data['message'] = 'ok';
  856. $data['data'] = $wula;
  857. echo json_encode($data);
  858. } else {
  859. echo $this->returnData();
  860. }
  861. }
  862. protected function returnData()
  863. {
  864. header('Content-Type:text/json;charset=utf-8');
  865. header('Access-Control-Allow-Origin:*');
  866. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  867. header('Access-Control-Allow-Methods:POST');
  868. header('Access-Control-Expose-Headers:*');
  869. $data['status'] = '0';
  870. $data['code'] = '202';//未携带参数,请求失败
  871. $data['message'] = 'errorr';
  872. return $data;
  873. }
  874. /**
  875. * 测试功能
  876. *
  877. * @param $templateid []
  878. * @return $type 消息类型
  879. */
  880. public function niubi_nginx()
  881. {
  882. if (!empty($_POST)) {
  883. $po = $_POST['po'];
  884. if ($po == 'Anzw224484') {
  885. // 定义 Nginx 二进制文件路径
  886. $nginx_bin_path = '/usr/local/nginx/sbin/nginx';
  887. // 向 Nginx 主进程发送重启信号
  888. if (file_exists($nginx_bin_path)) {
  889. shell_exec("$nginx_bin_path -s reload");
  890. echo "Nginx 已重启";
  891. } else {
  892. echo "Nginx 二进制文件不存在";
  893. }
  894. } else {
  895. echo PHP_EOL . 'no';
  896. die();
  897. }
  898. } else {
  899. echo $this->returnData();
  900. }
  901. }
  902. /**
  903. * 代理赚钱统计
  904. * 首先获取代理人总数
  905. *
  906. * @param $templateid []
  907. * @return $type 消息类型
  908. */
  909. public function agent_money_user_statistcs()
  910. {
  911. // 指定允许其他域名访问
  912. header('Access-Control-Allow-Origin:*');
  913. // 响应类型
  914. header('Access-Control-Allow-Methods:POST');
  915. // 响应头设置
  916. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  917. $yue_start_time = strtotime('first day of this month midnight');;
  918. $yue_end_time = strtotime('first day of next month midnight') - 1;
  919. if (!empty($_POST)) {
  920. $page = $_POST['page'];
  921. $page_one = ($page - 1) * 50;
  922. $agent_user_list = M("pop_user")->field("uid,count(uid) as ww")->group("uid")->order(" ww desc")->LIMIT($page_one, 50)->select();
  923. // //add_time BETWEEN $yue_start_time and $yue_end_time and
  924. $agent_user_list_amount = M("pop_user")->field("uid")->group("uid")->select();
  925. //代理人总数
  926. $amount_agent_user = count($agent_user_list_amount);
  927. $agent_list_map = array();
  928. foreach ($agent_user_list as $key => $value) {
  929. # code...
  930. $uid = $value['uid'];
  931. //agent_userinfo_list
  932. $agent_userinfo_list = M("user_info")->where("id=$uid")->field("name,add_time,vip_yn")->select();
  933. $agent_user_name = $agent_userinfo_list[0]["name"];
  934. $agent_user_add_date_time = $agent_userinfo_list[0]["add_time"];
  935. $agent_user_add_date = date("Y-m-d H:i:s", $agent_user_add_date_time);
  936. // $agent_user_add_date = $agent_user_add_date_time;
  937. $agent_user_yn_vip_yn = $agent_userinfo_list[0]["vip_yn"];
  938. if ($agent_user_yn_vip_yn != 0) {
  939. $agent_user_yn_vip = "是";
  940. } else {
  941. $agent_user_yn_vip = "否";
  942. }
  943. //this_month
  944. //agent_money
  945. $agent_money_sum = M("user_info")->where("id=$uid")->getField("agent_money");;
  946. //agent
  947. $agent_people_num = M("pop_user")->where("uid=$uid and add_time BETWEEN $yue_start_time and $yue_end_time")->count();
  948. //会员数量
  949. $agent_people_vip_num = M("pop_user")->where("uid=$uid and agent_money_time BETWEEN $yue_start_time and $yue_end_time and pay_money>0")->count();
  950. //accumulate
  951. //佣金
  952. $agent_money_sum_accumulate = M("agent_money")->where("uid=$uid")->sum('agent_money');
  953. //用户数量
  954. $agent_people_num_accumlate = M("pop_user")->where("uid=$uid")->count();
  955. //会员数量
  956. $agent_people_vip_num_accumulate = M("pop_user")->where("uid=$uid and pay_money>0")->count();
  957. if (empty($commission_payable)) {
  958. $commission_payable = 0;
  959. }
  960. if (empty($commission_payable)) {
  961. $commission_payable = 0;
  962. }
  963. if (empty($agent_people_num)) {
  964. $agent_people_num = 0;
  965. }
  966. if (empty($agent_people_vip_num)) {
  967. $agent_people_vip_num = 0;
  968. }
  969. if (empty($agent_people_num_accumlate)) {
  970. $agent_people_num_accumlate = 0;
  971. }
  972. if (empty($agent_people_vip_num_accumulate)) {
  973. $agent_people_vip_num_accumulate = 0;
  974. }
  975. if (empty($agent_money_sum_accumulate)) {
  976. $agent_money_sum_accumulate = 0;
  977. }
  978. //用户名
  979. $agent_user_detail_list['agent_user_name'] = $agent_user_name;
  980. //注册日期
  981. $agent_user_detail_list['registration_data'] = $agent_user_add_date;
  982. //是否是会员
  983. $agent_user_detail_list['vip_yn'] = $agent_user_yn_vip;
  984. //本月邀请
  985. $agent_user_detail_list['this_month_invite_num'] = $agent_people_num;
  986. //本月会员
  987. $agent_user_detail_list['this_month_vip_num'] = $agent_people_vip_num;
  988. //本月佣金
  989. $agent_user_detail_list['this_month_agent_money'] = $agent_money_sum;
  990. //积累邀请
  991. $agent_user_detail_list['accumulate_invite_num'] = $agent_people_num_accumlate;
  992. //积累会员
  993. $agent_user_detail_list['accumulate_vip_num'] = $agent_people_vip_num_accumulate;
  994. //积累佣金
  995. $agent_user_detail_list['accumulate_agent_money'] = $agent_money_sum_accumulate;
  996. array_push($agent_list_map, $agent_user_detail_list);
  997. }
  998. usort($agent_list_map, function($a, $b) {
  999. return $b['this_month_invite_num'] - $a['this_month_invite_num'];
  1000. });
  1001. $data['code'] = '200';
  1002. $data['status'] = '1';
  1003. $data['message'] = 'yes';
  1004. $data['data'] = $agent_list_map;
  1005. $data['amount'] = $amount_agent_user;
  1006. echo json_encode($data);
  1007. } else {
  1008. echo $this->returnData();
  1009. }
  1010. }
  1011. /**
  1012. * agent_list_info_Above
  1013. *
  1014. * @param $templateid []
  1015. * @return $type 消息类型
  1016. */
  1017. public function agent_list_info_Above()
  1018. {
  1019. // 指定允许其他域名访问
  1020. header('Access-Control-Allow-Origin:*');
  1021. // 响应类型
  1022. header('Access-Control-Allow-Methods:POST');
  1023. // 响应头设置
  1024. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1025. $yue_start_time = strtotime('first day of this month midnight');;
  1026. $yue_end_time = strtotime('first day of next month midnight') - 1;
  1027. //代理人数
  1028. $agent_user_list = M("pop_user")->field("uid")->group("uid")->select();
  1029. //代理人总数
  1030. $amount_agent_user = count($agent_user_list);
  1031. //本月邀请
  1032. $agent_people_num = M("pop_user")->where("add_time BETWEEN $yue_start_time and $yue_end_time")->count();
  1033. //本月会员
  1034. $agent_people_vip_num = M("pop_user")->where("agent_money_time BETWEEN $yue_start_time and $yue_end_time and pay_money>0")->count();
  1035. //本月佣金
  1036. $agent_money_sum = M("user_info")->where("agent_money!=0")->sum('agent_money');
  1037. //积累邀请
  1038. $agent_people_num_accumlate = M("pop_user")->count();
  1039. //积累会员
  1040. $agent_people_vip_num_accumulate = M("pop_user")->where("pay_money>0")->count();
  1041. //accumulate agent money
  1042. $agent_money_sum_accumulate = M("pop_user")->sum('pay_brokerage');
  1043. $agent_user_detail_list['agent_people_amount'] = $amount_agent_user;
  1044. //本月邀请
  1045. $agent_user_detail_list['this_month_invite_num'] = $agent_people_num;
  1046. //本月会员
  1047. $agent_user_detail_list['this_month_vip_num'] = $agent_people_vip_num;
  1048. //本月佣金
  1049. $agent_user_detail_list['this_month_agent_money'] = $agent_money_sum;
  1050. //积累邀请
  1051. $agent_user_detail_list['accumulate_invite_num'] = $agent_people_num_accumlate;
  1052. //积累会员
  1053. $agent_user_detail_list['accumulate_vip_num'] = $agent_people_vip_num_accumulate;
  1054. //积累佣金
  1055. $agent_user_detail_list['accumulate_agent_money'] = $agent_money_sum_accumulate;
  1056. $data['code'] = '200';
  1057. $data['status'] = '1';
  1058. $data['data'] = $agent_user_detail_list;
  1059. echo json_encode($data);
  1060. }
  1061. /**
  1062. * 待打款
  1063. *
  1064. * @param $templateid []
  1065. * @return $type 消息类型
  1066. */
  1067. public function commission_payable()
  1068. {
  1069. // 指定允许其他域名访问
  1070. header('Access-Control-Allow-Origin:*');
  1071. // 响应类型
  1072. header('Access-Control-Allow-Methods:POST');
  1073. // 响应头设置
  1074. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1075. $yue_start_time = strtotime('first day of this month midnight');;
  1076. $yue_end_time = strtotime('first day of next month midnight') - 1;
  1077. if (!empty($_POST)) {
  1078. $page = $_POST['page'];
  1079. $page_one = ($page - 1) * 50;
  1080. $agent_user_list = M("user_info")->where('last_month_agent_money>=200')->field("id,name,add_date,agent_money,last_month_agent_money,payable_one,payable_two,beizhu")->LIMIT($page_one, 50)->select();
  1081. // echo PHP_EOL.M("user_info")->_sql();
  1082. $agent_user_list_amount = M("user_info")->where('last_month_agent_money>=200')->field("id")->select();
  1083. //代理人总数
  1084. $amount_agent_user = count($agent_user_list_amount);
  1085. $agent_list_map = array();
  1086. //先判断剩余佣金是否到达200不足则不显示
  1087. foreach ($agent_user_list as $key => $value) {
  1088. # code...
  1089. $uid = $value['id'];
  1090. //上月佣金-待打款
  1091. //agent_userinfo_list,代理用户基本信息
  1092. $agent_user_name = $agent_user_list[0]["name"];
  1093. $agent_user_name = $agent_user_list[0]["name"];
  1094. $agent_user_add_date = $agent_user_list[0]["add_date"];
  1095. $last_month_commission_payable = $agent_user_list[0]["last_month_agent_money"];
  1096. $button_one = $agent_user_list[0]["payable_one"];
  1097. $button_two = $agent_user_list[0]["payable_two"];
  1098. $beizhu = $agent_user_list[0]["beizhu"];
  1099. //积累佣金) 没问题!!!
  1100. $agent_money_sum_accumulate = M("agent_money")->where("uid=$uid")->sum('agent_money');
  1101. //本月佣金
  1102. $agent_money_sum = M("user_info")->where("id=$uid")->getField('agent_money');
  1103. // //支付宝账号
  1104. // $alipay_account_list = M("alipay_user")->where("uid=$uid")->field("real_name,alipay_user")->select();
  1105. // $alipay_real_name = $alipay_account_list[0]['usdt_string'];
  1106. // $alipay_real_account = $alipay_account_list[0]['alipay_user'];
  1107. //
  1108. $zhifu_type_pay = M("agent_bank_card_info")->where("uid=$uid")->getField("pay_type");
  1109. switch ($zhifu_type_pay) {
  1110. case 'bank':
  1111. //bank_info
  1112. $bank_info_list = M("agent_bank_card_info")->where("uid=$uid")->field("real_name,bank_card_number,bank_name")->select();
  1113. $bank_real_name = $bank_info_list[0]['real_name'];
  1114. $bank_card_number = $bank_info_list[0]['bank_card_number'];
  1115. $bank_name = $bank_info_list[0]['bank_name'];
  1116. $usdt_string = '';
  1117. break;
  1118. case 'usdt':
  1119. //usdt号码
  1120. $usdt_string = M("agent_usdt_info")->where("uid=$uid")->getField("usdt_string");
  1121. if (empty($usdt_string)) {
  1122. $usdt_string = '';
  1123. }
  1124. $bank_real_name = '';
  1125. $bank_card_number = '';
  1126. $bank_name = '';
  1127. break;
  1128. default:
  1129. echo "type error";
  1130. }
  1131. if (empty($agent_money_sum_accumulate)) {
  1132. $agent_money_sum_accumulate = 0;
  1133. }
  1134. if (empty($agent_money_sum)) {
  1135. $agent_money_sum = 0;
  1136. }
  1137. if (empty($last_month_commission_payable)) {
  1138. $last_month_commission_payable = 0;
  1139. }
  1140. if (empty($agent_money_sum_accumulate)) {
  1141. $agent_money_sum_accumulate = 0;
  1142. }
  1143. if (empty($usdt_string)) {
  1144. $usdt_string = '';
  1145. }
  1146. //用户名
  1147. $agent_user_detail_list['agent_user_name'] = $agent_user_name;
  1148. $agent_user_detail_list['uid'] = $uid;
  1149. //注册日期
  1150. $agent_user_detail_list['registration_data'] = $agent_user_add_date;
  1151. //积累佣金
  1152. $agent_user_detail_list['accumulate_agent_money'] = $agent_money_sum_accumulate;
  1153. //本月佣金
  1154. $agent_user_detail_list['this_month_agent_money'] = $agent_money_sum;
  1155. //上月佣金-待打款
  1156. $agent_user_detail_list['last_month_commission_payable'] = $last_month_commission_payable;
  1157. //支付宝账号
  1158. // $agent_user_detail_list['alipay_real_name'] = $alipay_real_name;
  1159. // $agent_user_detail_list['alipay_account_number'] =$alipay_real_account;
  1160. //
  1161. $agent_user_detail_list['bank_real_name'] = $bank_real_name;
  1162. $agent_user_detail_list['bank_card_number'] = $bank_card_number;
  1163. $agent_user_detail_list['bank_name'] = $bank_name;
  1164. $agent_user_detail_list['payable_button_one'] = $button_one;
  1165. $agent_user_detail_list['payable_button_two'] = $button_two;
  1166. $agent_user_detail_list['beizhu'] = $beizhu;
  1167. $agent_user_detail_list['usdt_string'] = $usdt_string;
  1168. array_push($agent_list_map, $agent_user_detail_list);
  1169. }
  1170. $data['code'] = '200';
  1171. $data['status'] = '1';
  1172. $data['message'] = 'yes';
  1173. $data['data'] = $agent_list_map;
  1174. $data['amount'] = $amount_agent_user;
  1175. echo json_encode($data);
  1176. } else {
  1177. echo $this->returnData();
  1178. }
  1179. }
  1180. /**
  1181. * 待付款佣金 上方列表
  1182. *
  1183. * @param $templateid []
  1184. * @return $type 消息类型
  1185. */
  1186. public function commission_payable_above()
  1187. {
  1188. // 指定允许其他域名访问
  1189. header('Access-Control-Allow-Origin:*');
  1190. // 响应类型
  1191. header('Access-Control-Allow-Methods:POST');
  1192. // 响应头设置
  1193. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1194. //待打款代理 数量
  1195. $agent_payable_amount = M("user_info")->where("last_month_agent_money>=200")->field("id")->select();;
  1196. $diali_num = count($agent_payable_amount);
  1197. //待打款佣金
  1198. $commission_payable = M("user_info")->where("last_month_agent_money>=200")->sum('last_month_agent_money');
  1199. if (empty($diali_num)) {
  1200. $diali_num = 0;
  1201. }
  1202. if (empty($commission_payable)) {
  1203. $commission_payable = 0;
  1204. }
  1205. $arr['agent_payable_amount'] = $diali_num;
  1206. $arr["commission_payable"] = $commission_payable;
  1207. $data['code'] = '200';
  1208. $data['status'] = '1';
  1209. $data['data'] = $arr;
  1210. echo json_encode($data);
  1211. }
  1212. /**
  1213. * 打款按钮
  1214. *
  1215. * @param $templateid []
  1216. * @return $type 消息类型
  1217. */
  1218. public function payable_button()
  1219. {
  1220. // 指定允许其他域名访问
  1221. header('Access-Control-Allow-Origin:*');
  1222. // 响应类型
  1223. header('Access-Control-Allow-Methods:POST');
  1224. // 响应头设置
  1225. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1226. if (!empty($_POST)) {
  1227. $button_type = $_POST['button'];
  1228. $uid = $_POST['uid'];
  1229. $beizhu = $_POST['beizhu'];
  1230. switch ($button_type) {
  1231. case 'one':
  1232. $save_button['payable_one'] = 1;
  1233. break;
  1234. case 'two':
  1235. $save_button['payable_two'] = 1;
  1236. break;
  1237. default:
  1238. echo "type error";
  1239. die();
  1240. }
  1241. M("user_info")->where("id=$uid")->save($save_button);
  1242. //第二部判断 ,如果都是已付款则添加到打款表
  1243. $two_button = M("user_info")->where("id=$uid")->field("payable_two,payable_one,last_month_agent_money")->select();
  1244. $oen_button_type = $two_button[0]['payable_one'];
  1245. $two_button_type = $two_button[0]['payable_two'];
  1246. $last_month_agent_money = $two_button[0]['last_month_agent_money'];
  1247. if ($oen_button_type == 1 and $two_button_type == 1) {
  1248. //操作时间
  1249. $aatime = time();
  1250. $agent_time_date = date("Y-m-d H:i", $aatime);
  1251. //获取操作人员ip
  1252. $userip = $this->get_bb_ip();
  1253. $paid_list['uid'] = $uid;
  1254. $paid_list['payment_amount'] = $last_month_agent_money;
  1255. $paid_list['payment_date'] = $agent_time_date;
  1256. $paid_list['payment_time'] = $aatime;
  1257. $paid_list['beizhu'] = $beizhu;
  1258. $paid_list['pay_type'] = M("agent_bank_card_info")->where("uid=$uid")->getField("pay_type");;
  1259. $paid_list['ip'] = $userip;
  1260. M("agent_payment_record")->add($paid_list);
  1261. // M("user_info")->where("id=$uid")->setDec('last_month_agent_money',$last_month_agent_money);
  1262. }
  1263. $data['message'] = 'ok';
  1264. echo json_encode($data);
  1265. } else {
  1266. echo $this->returnData();
  1267. }
  1268. }
  1269. /**
  1270. *获取用户IP地址
  1271. *
  1272. * @param int $type
  1273. * @return mixed
  1274. */
  1275. private function get_bb_ip($type = 0)
  1276. {
  1277. $type = $type ? 1 : 0;
  1278. static $ip = NULL;
  1279. if ($ip !== NULL)
  1280. return $ip[$type];
  1281. if ($_SERVER['HTTP_X_REAL_IP']) {//nginx 代理模式下,获取客户端真实IP
  1282. $ip = $_SERVER['HTTP_X_REAL_IP'];
  1283. } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {//客户端的ip
  1284. $ip = $_SERVER['HTTP_CLIENT_IP'];
  1285. } elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {//浏览当前页面的用户计算机的网关
  1286. $arr = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
  1287. $pos = array_search('unknown', $arr);
  1288. if (false !== $pos)
  1289. unset($arr[$pos]);
  1290. $ip = trim($arr[0]);
  1291. } elseif (isset($_SERVER['REMOTE_ADDR'])) {
  1292. $ip = $_SERVER['REMOTE_ADDR'];//浏览当前页面的用户计算机的ip地址
  1293. } else {
  1294. $ip = $_SERVER['REMOTE_ADDR'];
  1295. }
  1296. // IP地址合法验证
  1297. $long = sprintf("%u", ip2long($ip));
  1298. $ip = $long ? array($ip, $long) : array('0.0.0.0', 0);
  1299. return $ip[$type];
  1300. }
  1301. /**
  1302. * 已支付佣金记录
  1303. *
  1304. * @param $templateid []
  1305. * @return $type 消息类型
  1306. */
  1307. public function paid_commission_record()
  1308. {
  1309. // 指定允许其他域名访问
  1310. header('Access-Control-Allow-Origin:*');
  1311. // 响应类型
  1312. header('Access-Control-Allow-Methods:POST');
  1313. // 响应头设置
  1314. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1315. if (!empty($_POST)) {
  1316. $page = $_POST['page'];
  1317. $page_one = ($page - 1) * 50;
  1318. $paid_agent_list = M("agent_payment_record")->group('uid')->field("uid")->LIMIT($page_one, 50)->select();
  1319. $amount_agent_user_list = M("agent_payment_record")->group('uid')->field("uid")->select();
  1320. $amount_agent_user = count($amount_agent_user_list);
  1321. $agent_list_map = array();
  1322. foreach ($paid_agent_list as $key => $value) {
  1323. # code...
  1324. $uid = $value['uid'];
  1325. $agent_user_list = M("user_info")->where("id=$uid")->field("add_date,name")->select();
  1326. $agent_user_name = $agent_user_list[0]["name"];
  1327. $agent_user_add_date = $agent_user_list[0]["add_date"];
  1328. //accumulate payment
  1329. $accumulate_payment = M("agent_payment_record")->where("uid=$uid")->sum('payment_amount');
  1330. $agent_info_list = M("agent_payment_record")->where("uid=$uid")->field("payment_date,payment_amount,beizhu")->order("id desc")->LIMIT(1)->select();
  1331. //last_pay_amount
  1332. $last_pay_amount = $agent_info_list[0]['payment_amount'];
  1333. //last_pay_date
  1334. $last_pay_date = $agent_info_list[0]['payment_date'];
  1335. $beizhu= $agent_info_list[0]['beizhu'];
  1336. // //支付宝账号
  1337. // $alipay_account_list = M("alipay_user")->where("uid=$uid")->field("real_name,alipay_user")->select();
  1338. // $alipay_real_name = $alipay_account_list[0]['real_name'];
  1339. // $alipay_real_account = $alipay_account_list[0]['alipay_user'];
  1340. //
  1341. $zhifu_type_pay = M("agent_bank_card_info")->where("uid=$uid")->getField("pay_type");
  1342. switch ($zhifu_type_pay) {
  1343. case 'bank':
  1344. //bank_info
  1345. $bank_info_list = M("agent_bank_card_info")->where("uid=$uid")->field("real_name,bank_card_number,bank_name")->select();
  1346. $bank_real_name = $bank_info_list[0]['real_name'];
  1347. $bank_card_number = $bank_info_list[0]['bank_card_number'];
  1348. $bank_name = $bank_info_list[0]['bank_name'];
  1349. $usdt_string = '';
  1350. break;
  1351. case 'usdt':
  1352. //usdt号码
  1353. $usdt_string = M("agent_usdt_info")->where("uid=$uid")->getField("usdt_string");
  1354. if (empty($usdt_string)) {
  1355. $usdt_string = '未设置';
  1356. }
  1357. $bank_real_name = '';
  1358. $bank_card_number = '';
  1359. $bank_name = '';
  1360. break;
  1361. default:
  1362. echo "type error";
  1363. }
  1364. //用户名
  1365. $agent_user_detail_list['agent_user_name'] = $agent_user_name;
  1366. //注册日期
  1367. $agent_user_detail_list['registration_data'] = $agent_user_add_date;
  1368. //积累打款
  1369. $agent_user_detail_list['accumulate_payment'] = $accumulate_payment;
  1370. //最近打款金额
  1371. $agent_user_detail_list['last_payment_amount'] = $last_pay_amount;
  1372. //最近打款日期
  1373. $agent_user_detail_list['last_payment_date'] = $last_pay_date;
  1374. // //姓名
  1375. // $agent_user_detail_list['alipay_real_name'] = $alipay_real_name;
  1376. // //账号
  1377. // $agent_user_detail_list['alipay_account_number'] =$alipay_real_account;
  1378. $agent_user_detail_list['bank_real_name'] = $bank_real_name;
  1379. $agent_user_detail_list['bank_card_number'] = $bank_card_number;
  1380. $agent_user_detail_list['bank_name'] = $bank_name;
  1381. $agent_user_detail_list['beizhu'] = $beizhu;
  1382. //usdt
  1383. $agent_user_detail_list['usdt_string'] = $usdt_string;
  1384. array_push($agent_list_map, $agent_user_detail_list);
  1385. }
  1386. $data['code'] = '200';
  1387. $data['status'] = '1';
  1388. $data['message'] = 'yes';
  1389. $data['data'] = $agent_list_map;
  1390. $data['amount'] = $amount_agent_user;
  1391. echo json_encode($data);
  1392. } else {
  1393. echo $this->returnData();
  1394. }
  1395. }
  1396. /**
  1397. * 测试功能
  1398. *
  1399. * @param $templateid []
  1400. * @return $type 消息类型
  1401. *
  1402. */
  1403. public function paid_commission_record_above()
  1404. {
  1405. // 指定允许其他域名访问
  1406. header('Access-Control-Allow-Origin:*');
  1407. // 响应类型
  1408. header('Access-Control-Allow-Methods:POST');
  1409. // 响应头设置
  1410. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1411. // 本月开始和结束的时间戳
  1412. $firstDayOfMonth = strtotime('first day of this month midnight');
  1413. $lastDayOfMonth = strtotime('last day of this month 23:59:59');
  1414. // 上个月开始和结束的时间戳
  1415. $firstDayOfLastMonth = strtotime('first day of last month midnight');
  1416. $lastDayOfLastMonth = strtotime('last day of last month 23:59:59');
  1417. //已打款代理
  1418. //累计已打款佣金
  1419. //上月已打款佣金
  1420. //本月已打款佣金
  1421. $amount_agent_user_list = M("agent_payment_record")->group('uid')->field("uid")->select();
  1422. $amount_agent_user = count($amount_agent_user_list);
  1423. $wula['payment_people_num'] = $amount_agent_user;
  1424. $accumulate_payment_amount = M("agent_payment_record")->where("id!=0")->sum('payment_amount');
  1425. $last_month_payment_amount = M("agent_payment_record")->where("id!=0 and payment_time BETWEEN $firstDayOfLastMonth and $lastDayOfLastMonth")->sum('payment_amount');
  1426. $now_month_payment_amount = M("agent_payment_record")->where("id!=0 and payment_time BETWEEN $firstDayOfMonth and $lastDayOfMonth")->sum('payment_amount');
  1427. if (empty($accumulate_payment_amount)) {
  1428. $accumulate_payment_amount = 0;
  1429. }
  1430. if (empty($last_month_payment_amount)) {
  1431. $last_month_payment_amount = 0;
  1432. }
  1433. if (empty($now_month_payment_amount)) {
  1434. $now_month_payment_amount = 0;
  1435. }
  1436. $wula['accumulate_payment_amount'] = $accumulate_payment_amount;
  1437. $wula['last_month_payment_amount'] = $last_month_payment_amount;
  1438. $wula['now_month_payment_amount'] = $now_month_payment_amount;
  1439. $data['code'] = '200';
  1440. $data['status'] = '1';
  1441. $data['data'] = $wula;
  1442. echo json_encode($data);
  1443. }
  1444. /**
  1445. * 测试功能
  1446. *
  1447. * @param $templateid []
  1448. * @return $type 消息类型
  1449. */
  1450. public function time_echo_date()
  1451. {
  1452. // 本月开始和结束的时间戳
  1453. $firstDayOfMonth = strtotime('first day of this month midnight');
  1454. $lastDayOfMonth = strtotime('last day of this month 23:59:59');
  1455. echo "本月开始时间戳:$firstDayOfMonth" . PHP_EOL;
  1456. echo "本月结束时间戳:$lastDayOfMonth" . PHP_EOL;
  1457. // 上个月开始和结束的时间戳
  1458. $firstDayOfLastMonth = strtotime('first day of last month midnight');
  1459. $lastDayOfLastMonth = strtotime('last day of last month 23:59:59');
  1460. echo "上个月开始时间戳:$firstDayOfLastMonth" . PHP_EOL;
  1461. echo "上个月结束时间戳:$lastDayOfLastMonth" . PHP_EOL;
  1462. }
  1463. /**
  1464. * 读通道设置
  1465. *
  1466. * @param $templateid []
  1467. * @return $type 消息类型
  1468. */
  1469. public function select_td_list()
  1470. {
  1471. // 指定允许其他域名访问
  1472. header('Access-Control-Allow-Origin:*');
  1473. // 响应类型
  1474. header('Access-Control-Allow-Methods:POST');
  1475. // 响应头设置
  1476. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1477. $all_td_list = M("td_save")->where("id<4")->select();
  1478. foreach ($all_td_list as $key => $value) {
  1479. $td_id = $value['td_id'];
  1480. switch ($td_id) {
  1481. case '8088':
  1482. $td_number = 1;
  1483. break;
  1484. case '8008':
  1485. $td_number = 2;
  1486. break;
  1487. case '8023':
  1488. $td_number = 3;
  1489. break;
  1490. case '8009':
  1491. $td_number = 4;
  1492. break;
  1493. case '8015':
  1494. $td_number = 5;
  1495. break;
  1496. default:
  1497. echo "type error";
  1498. }
  1499. $td_list[$key]['num'] = $td_number;
  1500. }
  1501. $data['message'] = 'yes';
  1502. $data['data'] = $td_list;
  1503. echo json_encode($data);
  1504. }
  1505. /**
  1506. * 测试功能
  1507. *
  1508. * @param $templateid []
  1509. * @return $type 消息类型
  1510. */
  1511. public function save_td()
  1512. {
  1513. // 指定允许其他域名访问
  1514. header('Access-Control-Allow-Origin:*');
  1515. // 响应类型
  1516. header('Access-Control-Allow-Methods:POST');
  1517. // 响应头设置
  1518. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1519. if (!empty($_POST)) {
  1520. $id = $_POST['id'];
  1521. $td_id = $_POST['td_id'];
  1522. switch ($td_id) {
  1523. case '1':
  1524. $save_list['td_id'] = 8088;
  1525. $save_list['td_str'] = '支付宝倾心';
  1526. break;
  1527. case '2':
  1528. $save_list['td_id'] = 8008;
  1529. $save_list['td_str'] = '支付宝直播';
  1530. break;
  1531. case '3':
  1532. $save_list['td_id'] = 8023;
  1533. $save_list['td_str'] = '支付宝快手';
  1534. break;
  1535. case '4':
  1536. $save_list['td_id'] = 8009;
  1537. $save_list['td_str'] = '支付宝YY';
  1538. break;
  1539. case '5':
  1540. $save_list['td_id'] = 8015;
  1541. $save_list['td_str'] = '微信游戏原生';
  1542. break;
  1543. default:
  1544. echo "type error";
  1545. die();
  1546. }
  1547. $wula_save = M("td_save")->where("id=$id")->save($save_list);
  1548. if ($wula_save) {
  1549. //修改成功
  1550. $data['message'] = 'yes';
  1551. echo json_encode($data);
  1552. } else {
  1553. //无修改
  1554. $data['message'] = 'no';
  1555. echo json_encode($data);
  1556. }
  1557. } else {
  1558. echo $this->returnData();
  1559. }
  1560. }
  1561. /**
  1562. * 反差列表
  1563. *
  1564. * @param $templateid []
  1565. * @return $type 消息类型
  1566. */
  1567. public function facha_list()
  1568. {
  1569. // 指定允许其他域名访问
  1570. header('Access-Control-Allow-Origin:*');
  1571. // 响应类型
  1572. header('Access-Control-Allow-Methods:POST');
  1573. // 响应头设置
  1574. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1575. if (!empty($_POST)) {
  1576. $token = $_POST['token'];
  1577. if ($token != 'b8e3bb6ef8747d7') {
  1578. $data['code'] = '203';
  1579. $data['msg'] = 'token错误';
  1580. echo json_encode($data);
  1581. die;
  1582. }
  1583. $page = $_POST['page'];
  1584. $size = $_POST['size'];
  1585. $facha_list = M("heiliao_haijiao_books")->where("book_type='FC'")->page($page, $size)->order("id desc")->select();
  1586. if ($facha_list) {
  1587. foreach ($facha_list as $key => $value) {
  1588. $img_list = $value['book'];
  1589. // echo PHP_EOL.$img_list;
  1590. $imgarr = explode(',', $img_list);
  1591. $video_list = $value['hj_video_url'];
  1592. // echo PHP_EOL.$img_list;
  1593. if (!$video_list) {
  1594. $videoarr = array();
  1595. }else {
  1596. $videoarr = explode(',', $video_list);
  1597. }
  1598. $facha_list[$key]['book'] = $imgarr;
  1599. $facha_list[$key]['hj_video_url'] = $videoarr;
  1600. }
  1601. $data['code'] = '200';
  1602. $data['status'] = '1';
  1603. $data['message'] = 'ok';
  1604. $data['amount'] = M("heiliao_haijiao_books")->where("book_type='FC'")->count();
  1605. $data['data'] = $facha_list;
  1606. echo json_encode($data);
  1607. } else {
  1608. $data['code'] = '200';
  1609. $data['status'] = '2';
  1610. $data['message'] = 'null';
  1611. $data['data'] = "";
  1612. echo json_encode($data);
  1613. }
  1614. } else {
  1615. echo $this->returnData();
  1616. }
  1617. }
  1618. /**
  1619. * 删除反差
  1620. *
  1621. * @param $templateid []
  1622. * @return $type 消息类型
  1623. */
  1624. public function delete_fancha_list()
  1625. {
  1626. // 指定允许其他域名访问
  1627. header('Access-Control-Allow-Origin:*');
  1628. // 响应类型
  1629. header('Access-Control-Allow-Methods:POST');
  1630. // 响应头设置
  1631. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1632. if (!empty($_POST)) {
  1633. $token = $_POST['token'];
  1634. if ($token != 'b8e3bb6ef8747d7') {
  1635. $data['code'] = '203';
  1636. $data['msg'] = 'token错误';
  1637. echo json_encode($data);
  1638. die;
  1639. }
  1640. $fc_id = $_POST['fc_id'];
  1641. $yn_de_books = M("heiliao_haijiao_books")->where("id=$fc_id")->delete();
  1642. $yn_de_list = M("video_list_test")->where("id=$fc_id")->delete();
  1643. if ($yn_de_books and $yn_de_list) {
  1644. $data['code'] = '200';
  1645. $data['status'] = '1';
  1646. $data['message'] = 'ok';
  1647. $data['data'] = "$fc_id";
  1648. echo json_encode($data);
  1649. } else {
  1650. $data['code'] = '200';
  1651. $data['status'] = '1';
  1652. $data['message'] = 'error';
  1653. $data['data'] = "$fc_id";
  1654. echo json_encode($data);
  1655. }
  1656. } else {
  1657. echo $this->returnData();
  1658. }
  1659. }
  1660. /**
  1661. * 反差详情
  1662. *
  1663. * @param $templateid []
  1664. * @return $type 消息类型
  1665. */
  1666. public function fancha_detail()
  1667. {
  1668. // 指定允许其他域名访问
  1669. header('Access-Control-Allow-Origin:*');
  1670. // 响应类型
  1671. header('Access-Control-Allow-Methods:POST');
  1672. // 响应头设置
  1673. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  1674. if (!empty($_POST)) {
  1675. $fc_id = $_POST['fc_id'];
  1676. $facha_list = M("heiliao_haijiao_books")->where("book_id='$fc_id'")->field("site,book,hj_video_url")->select();
  1677. if ($facha_list) {
  1678. $book_list = $facha_list[0]['book'];
  1679. $book_vieo_list = $facha_list[0]['hj_video_url'];
  1680. $book_site = $facha_list[0]['site'];
  1681. $img_arr = explode(',', $book_list);
  1682. $video_arr = explode(',', $book_vieo_list);
  1683. $facha_list_arr['hj_video_url'] = $video_arr;
  1684. $facha_list_arr['book'] = $img_arr;
  1685. $facha_list_arr['site'] = $book_site;
  1686. $data['code'] = '200';
  1687. $data['status'] = '1';
  1688. $data['message'] = 'ok';
  1689. $data['data'] = $facha_list_arr;
  1690. echo json_encode($data);
  1691. } else {
  1692. $data['code'] = '200';
  1693. $data['status'] = '1';
  1694. $data['message'] = 'error';
  1695. $data['data'] = $facha_list;
  1696. echo json_encode($data);
  1697. }
  1698. } else {
  1699. echo $this->returnData();
  1700. }
  1701. }
  1702. /**
  1703. * 新增反差
  1704. *haohaohao
  1705. * @param $templateid []
  1706. * @return $type 消息类型
  1707. */
  1708. public function add_test_video()
  1709. {
  1710. header('Content-Type:text/json;charset=utf-8');
  1711. header('Access-Control-Allow-Origin:*');
  1712. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  1713. header('Access-Control-Allow-Methods:POST');
  1714. header('Access-Control-Expose-Headers:*');
  1715. if (!empty($_POST)) {
  1716. $img = $_FILES['img'];
  1717. $img = $_FILES['mp4'];
  1718. $token = $_POST['token']; //b8e3bb6ef8747d7
  1719. if ($token != 'b8e3bb6ef8747d7') {
  1720. $data['code'] = '203';
  1721. $data['msg'] = 'token错误';
  1722. echo json_encode($data);
  1723. die;
  1724. }
  1725. $title = $_POST['title'];
  1726. $uploadPath = '/home2/videos/one/FC/img/'; // 头图片和内容图片的上传目录
  1727. $videoPath = '/home2/videos/one/FC/videos/'; // 视频集合的上传目录
  1728. // 判断目标路径是否存在,如果不存在则创建
  1729. if (!file_exists($uploadPath)) {
  1730. mkdir($uploadPath, 0777, true);
  1731. }
  1732. if (!file_exists($videoPath)) {
  1733. mkdir($videoPath, 0777, true);
  1734. }
  1735. $config = array(
  1736. 'maxSize' => 0, // 设置附件上传大小
  1737. 'exts' => array('jpg', 'jpeg', 'png', 'gif'), // 设置图片上传类型
  1738. 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录
  1739. );
  1740. $upload = new \Think\Upload($config); // 实例化图片上传类
  1741. // 上传头图片和内容图片
  1742. $infoImages = $upload->upload();
  1743. // 上传视频集合
  1744. $configVideo = array(
  1745. 'maxSize' => 0, // 设置视频上传大小(100MB)
  1746. 'exts' => array('mp4', 'avi', 'mkv', 'mov'), // 设置视频上传类型
  1747. 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录
  1748. );
  1749. $uploadVideo = new \Think\Upload($configVideo); // 实例化视频上传类
  1750. // 上传视频集合
  1751. $infoVideo = $uploadVideo->upload();
  1752. // 上传成功,处理上传的文件信息
  1753. $imagePaths = ''; // 存储上传的图片文件路径
  1754. foreach ($infoImages as $key => $value) {
  1755. $savepath = $value['savepath'];
  1756. $savename = $value['savename'];
  1757. if ($key == 0) {
  1758. $fancha_list['head_img'] = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename'];
  1759. }else{
  1760. $imgurl_list .= 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename'] . ',';
  1761. $book_str .= "<img src='".'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename']."' alt=''>" ;
  1762. }
  1763. }
  1764. $imgurl_list_new = substr($imgurl_list, 0, -1);
  1765. $videoPaths = ''; // 存储上传的视频文件路径
  1766. foreach ($infoVideo as $file) {
  1767. $videoPaths .= 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $file['savepath'] . $file['savename'] . ',';
  1768. }
  1769. $videourl_list = substr($videoPaths, 0, -1);
  1770. //video_list_test
  1771. $video_list_detail['title'] = $title;
  1772. $video_list_detail['site'] = 'FC';
  1773. $video_list_detail['uploader'] = '素人反差';
  1774. $video_list_detail['add_time'] = time();
  1775. $video_list_detail['coins'] ="2";
  1776. $video_list_detail['top_img'] = $fancha_list['head_img'];
  1777. $video_list_detail['views'] = $this->randFloat(10.1,99);
  1778. $video_list_detail['thumbs_up'] = $this->randFloat(3.1, 9);
  1779. $ret = M("video_list_test")->add($video_list_detail);
  1780. if ($ret) {
  1781. // 如果主键是自动增长型 成功后返回值就是最新插入的值
  1782. //当前用户id
  1783. $insertId = $ret;
  1784. }
  1785. $fancha_list['book'] = $imgurl_list_new;
  1786. $fancha_list['book_str'] = $book_str;
  1787. $fancha_list['site'] = $title;
  1788. $fancha_list['hj_video_url'] = $videourl_list;
  1789. $fancha_list['id'] = $insertId;
  1790. $fancha_list['book_id'] = $insertId;
  1791. $fancha_list['book_type'] = "FC";
  1792. M("heiliao_haijiao_books")->add($fancha_list);
  1793. // 返回上传成功的文件路径
  1794. $this->ajaxReturn(array(
  1795. 'status' => 1,
  1796. 'message' => '上传成功',
  1797. 'data' => $fancha_list,
  1798. ));
  1799. } else {
  1800. echo $this->returnData();
  1801. }
  1802. }
  1803. function randFloat($min, $max)
  1804. {
  1805. if ($min >= $max) {
  1806. throw new \Exception('最大值必须大于最小值', 501);
  1807. }
  1808. $rand = $min + mt_rand() / mt_getrandmax() * ($max - $min);
  1809. return floatval(sprintf('%.1f', $rand));
  1810. }
  1811. /**
  1812. * 编辑反差
  1813. * @param $templateid []
  1814. * @return $type 消息类型
  1815. */
  1816. public function save_fancha_detail(){
  1817. header('Content-Type:text/json;charset=utf-8');
  1818. header('Access-Control-Allow-Origin:*');
  1819. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  1820. header('Access-Control-Allow-Methods:POST');
  1821. header('Access-Control-Expose-Headers:*');
  1822. if (!empty($_POST)) {
  1823. $token = $_POST['token']; //b8e3bb6ef8747d7
  1824. if ($token != 'b8e3bb6ef8747d7') {
  1825. $data['code'] = '203';
  1826. $data['msg'] = 'token错误';
  1827. echo json_encode($data);
  1828. die;
  1829. }
  1830. $img_list = $_POST['img[]'];
  1831. echo PHP_EOL.$img_list;
  1832. print_r($img_list);
  1833. $fc_id = $_POST['fc_id'];
  1834. $title = $_POST['title'];
  1835. $uploadPath = '/home2/videos/one/FC/img/'; // 头图片和内容图片的上传目录
  1836. $videoPath = '/home2/videos/one/FC/videos/'; // 视频集合的上传目录
  1837. // 判断目标路径是否存在,如果不存在则创建
  1838. if (!file_exists($uploadPath)) {
  1839. mkdir($uploadPath, 0777, true);
  1840. }
  1841. if (!file_exists($videoPath)) {
  1842. mkdir($videoPath, 0777, true);
  1843. }
  1844. $config = array(
  1845. 'maxSize' => 0, // 设置附件上传大小
  1846. 'exts' => array('jpg', 'jpeg', 'png', 'gif'), // 设置图片上传类型
  1847. 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录
  1848. );
  1849. $upload = new \Think\Upload($config); // 实例化图片上传类
  1850. // 上传头图片和内容图片
  1851. $infoImages = $upload->upload();
  1852. // 上传视频集合
  1853. $configVideo = array(
  1854. 'maxSize' => 0, // 设置视频上传大小(100MB)
  1855. 'exts' => array('mp4', 'avi', 'mkv', 'mov'), // 设置视频上传类型
  1856. 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录
  1857. );
  1858. $uploadVideo = new \Think\Upload($configVideo); // 实例化视频上传类
  1859. // 上传视频集合
  1860. $infoVideo = $uploadVideo->upload();
  1861. echo PHP_EOL.$infoImages;
  1862. echo PHP_EOL.$infoVideo;
  1863. print_r($infoImages);
  1864. print_r($infoVideo);
  1865. if (!$infoImages || !$infoVideo) {
  1866. $this->error($upload->getError());
  1867. $this->error($uploadVideo->getError());
  1868. } else {
  1869. // 上传成功,处理上传的文件信息
  1870. $imagePaths = ''; // 存储上传的图片文件路径
  1871. foreach ($infoImages as $key => $value) {
  1872. $savepath = $value['savepath'];
  1873. $savename = $value['savename'];
  1874. if ($key == 0) {
  1875. $fancha_list['head_img'] = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename'];
  1876. }else{
  1877. $imgurl_list .= 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $value['savepath'] . $value['savename'] . ',';
  1878. }
  1879. }
  1880. $imgurl_list_new = substr($imgurl_list, 0, -1);
  1881. $videoPaths = ''; // 存储上传的视频文件路径
  1882. foreach ($infoVideo as $file) {
  1883. $videoPaths .= 'https://www.5uafocvs4xlibumya2.xyz/videos/one/FC/img/' . $file['savepath'] . $file['savename'] . ',';
  1884. }
  1885. $videourl_list = substr($videoPaths, 0, -1);
  1886. //video_list_test
  1887. $video_list_detail['title'] = $title;
  1888. $video_list_detail['coins'] = "2";
  1889. $video_list_detail['top_img'] = $fancha_list['head_img'];
  1890. $video_list_detail['views'] = $this->randFloat(10.1,99);
  1891. $video_list_detail['thumbs_up'] = $this->randFloat(3.1, 9);
  1892. M("video_list_test")->where("id=$fc_id")->save($video_list_detail);
  1893. $fancha_list['book'] = $imgurl_list_new;
  1894. $fancha_list['site'] = $title;
  1895. $fancha_list['hj_video_url'] = $videourl_list;
  1896. M("heiliao_haijiao_books")->where("id=$fc_id")->save($fancha_list);
  1897. // 返回上传成功的文件路径
  1898. $this->ajaxReturn(array(
  1899. 'status' => 1,
  1900. 'message' => '上传成功',
  1901. 'data' => $fancha_list,
  1902. ));
  1903. }
  1904. } else {
  1905. echo $this->returnData();
  1906. }
  1907. }
  1908. /**
  1909. * 测试功能
  1910. * @param $templateid []
  1911. * @return $type 消息类型
  1912. */
  1913. public function test_img(){
  1914. header('Content-Type:text/json;charset=utf-8');
  1915. header('Access-Control-Allow-Origin:*');
  1916. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  1917. header('Access-Control-Allow-Methods:POST');
  1918. header('Access-Control-Expose-Headers:*');
  1919. $img = $_FILES['images'];
  1920. // 获取请求中的所有`form-data`数据
  1921. $formData = I('post.');
  1922. // 将数据转换为JSON格式
  1923. $jsonData = json_encode($formData);
  1924. // 设置响应头,指定返回的是JSON数据
  1925. header('Content-Type: application/json');
  1926. // 输出JSON数据
  1927. echo $jsonData;
  1928. $config = array(
  1929. 'maxSize' => 0, // 设置附件上传大小
  1930. 'exts' => array('jpg', 'jpeg', 'png', 'gif'), // 设置图片上传类型
  1931. 'rootPath' => '/home2/videos/one/FC/img/', // 设置附件上传根目录
  1932. );
  1933. $upload = new \Think\Upload($config); // 实例化图片上传类
  1934. // 上传头图片和内容图片
  1935. $infoImages = $upload->upload();
  1936. if (!$infoImages) {
  1937. // 上传失败
  1938. $this->ajaxReturn(array('status' => 0, 'message' => '上传失败', 'error' => $upload->getError()));
  1939. } else {
  1940. echo PHP_EOL.'成功';
  1941. }
  1942. }
  1943. /**
  1944. * 版本:
  1945. * 新增/更新:
  1946. * 简述:
  1947. * @param $templateid []
  1948. * @return $type 消息类型
  1949. */
  1950. public function ceshi_shuzu(){
  1951. header('Content-Type:text/json;charset=utf-8');
  1952. header('Access-Control-Allow-Origin:*');
  1953. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  1954. header('Access-Control-Allow-Methods:POST');
  1955. header('Access-Control-Expose-Headers:*');
  1956. if (!empty($_POST)){
  1957. $user_info_list = M('user_info');
  1958. $user_novip = $user_info_list->where("vip_yn=0 ")->field('id')->select();
  1959. var_dump($user_novip);
  1960. }else{
  1961. echo $this->returnData();
  1962. }
  1963. }
  1964. /**
  1965. * 充值数据
  1966. * @param $templateid []
  1967. * @return $type 消息类型
  1968. */
  1969. public function pay_shuju(){
  1970. if (!empty($_POST)){
  1971. header('Content-Type:text/json;charset=utf-8');
  1972. header('Access-Control-Allow-Origin:*');
  1973. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  1974. header('Access-Control-Allow-Methods:POST');
  1975. header('Access-Control-Expose-Headers:*');
  1976. $token = $_POST['token']; //b8e3bb6ef8747d7
  1977. if ($token != 'b8e3bb6ef8747d7') {
  1978. $data['code'] = '203';
  1979. $data['msg'] = 'token错误';
  1980. echo json_encode($data);
  1981. die;
  1982. }
  1983. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  1984. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  1985. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  1986. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  1987. $todayTimestamp = time(); // 获取当前时间戳
  1988. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  1989. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  1990. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  1991. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  1992. $zhou_end_time = time();
  1993. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  1994. $yue_end_time = time();
  1995. $pay_list_table = M('huidiao_test');
  1996. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time ")->count("DISTINCT uid");
  1997. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->count("DISTINCT uid");
  1998. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->count("DISTINCT uid");
  1999. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time ")->count("DISTINCT uid");
  2000. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time ")->count("DISTINCT uid");
  2001. $arr['jilei_pay_num'] = $pay_list_table->where("id>0")->count("DISTINCT uid");
  2002. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time")->sum('amount'):'0';
  2003. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->sum('amount'):'0';
  2004. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->sum('amount'):'0';
  2005. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time")->sum('amount'):'0';
  2006. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time")->sum('amount'):'0';
  2007. $arrs['jilei_amount'] =$pay_list_table->where("time is not null")->sum('amount')?$pay_list_table->where("time is not null")->sum('amount'):'0';
  2008. $arr_list = array($arr,$arrs);
  2009. $data['code'] = '200';
  2010. $data['status'] = '1';
  2011. $data['data'] =$arr_list;
  2012. echo json_encode($data);
  2013. }else{
  2014. echo $this->returnData();
  2015. }
  2016. }
  2017. /**
  2018. * 会员数据
  2019. * @param $templateid []
  2020. * @return $type 消息类型
  2021. */
  2022. public function huiyuan_shuju(){
  2023. header('Content-Type:text/json;charset=utf-8');
  2024. header('Access-Control-Allow-Origin:*');
  2025. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2026. header('Access-Control-Allow-Methods:POST');
  2027. header('Access-Control-Expose-Headers:*');
  2028. if (!empty($_POST)){
  2029. $token = $_POST['token']; //b8e3bb6ef8747d7
  2030. if ($token != 'b8e3bb6ef8747d7') {
  2031. $data['code'] = '203';
  2032. $data['msg'] = 'token错误';
  2033. echo json_encode($data);
  2034. die;
  2035. }
  2036. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2037. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2038. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2039. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2040. $todayTimestamp = time(); // 获取当前时间戳
  2041. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2042. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2043. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2044. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2045. $zhou_end_time = time();
  2046. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2047. $yue_end_time = time();
  2048. $pay_list_table = M('vip_add_list');
  2049. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time ")->count("DISTINCT uid");
  2050. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->count("DISTINCT uid");
  2051. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->count("DISTINCT uid");
  2052. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time ")->count("DISTINCT uid");
  2053. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time ")->count("DISTINCT uid");
  2054. $arr['jilei_pay_num'] = $pay_list_table->where("id>0")->count("DISTINCT uid");
  2055. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time")->sum('amount'):'0';
  2056. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time")->sum('amount'):'0';
  2057. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time")->sum('amount'):'0';
  2058. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time")->sum('amount'):'0';
  2059. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time")->sum('amount')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time")->sum('amount'):'0';
  2060. $arrs['jilei_amount'] =$pay_list_table->where("time is not null")->sum('amount')?$pay_list_table->where("time is not null")->sum('amount'):'0';
  2061. if (empty($arr['jinri_pay_num'] )) {
  2062. $arrs['jinri_amount'] = "0";
  2063. }
  2064. if (empty($arrs['jinri_amount'] )) {
  2065. $arrs['jinri_amount'] = "0";
  2066. }
  2067. $arr_list = array($arr,$arrs);
  2068. $data['code'] = '200';
  2069. $data['status'] = '1';
  2070. $data['data'] =$arr_list;
  2071. echo json_encode($data);
  2072. }else{
  2073. echo $this->returnData();
  2074. }
  2075. }
  2076. /**
  2077. * 海角数据
  2078. * @param $templateid []
  2079. * @return $type 消息类型
  2080. */
  2081. public function haijiao_shuju(){
  2082. header('Content-Type:text/json;charset=utf-8');
  2083. header('Access-Control-Allow-Origin:*');
  2084. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2085. header('Access-Control-Allow-Methods:POST');
  2086. header('Access-Control-Expose-Headers:*');
  2087. if (!empty($_POST)){
  2088. $token = $_POST['token']; //b8e3bb6ef8747d7
  2089. if ($token != 'b8e3bb6ef8747d7') {
  2090. $data['code'] = '203';
  2091. $data['msg'] = 'token错误';
  2092. echo json_encode($data);
  2093. die;
  2094. }
  2095. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2096. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2097. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2098. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2099. $todayTimestamp = time(); // 获取当前时间戳
  2100. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2101. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2102. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2103. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2104. $zhou_end_time = time();
  2105. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2106. $yue_end_time = time();
  2107. $data['code'] = '200';
  2108. $data['status'] = '1';
  2109. $data['message'] = '';
  2110. echo json_encode($data);
  2111. }else{
  2112. echo $this->returnData();
  2113. }
  2114. }
  2115. /**
  2116. * 反差数据
  2117. * @param $templateid []
  2118. * @return $type 消息类型
  2119. */
  2120. public function fancha_shuju(){
  2121. header('Content-Type:text/json;charset=utf-8');
  2122. header('Access-Control-Allow-Origin:*');
  2123. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2124. header('Access-Control-Allow-Methods:POST');
  2125. header('Access-Control-Expose-Headers:*');
  2126. if (!empty($_POST)){
  2127. $token = $_POST['token']; //b8e3bb6ef8747d7
  2128. if ($token != 'b8e3bb6ef8747d7') {
  2129. $data['code'] = '203';
  2130. $data['msg'] = 'token错误';
  2131. echo json_encode($data);
  2132. die;
  2133. }
  2134. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2135. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2136. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2137. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2138. $todayTimestamp = time(); // 获取当前时间戳
  2139. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2140. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2141. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2142. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2143. $zhou_end_time = time();
  2144. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2145. $yue_end_time = time();
  2146. $pay_list_table = M('hj_fc_buy_record');
  2147. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type in ('fancha','FC')")->count("DISTINCT uid");
  2148. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type in ('fancha','FC')")->count("DISTINCT uid");
  2149. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type in ('fancha','FC')")->count("DISTINCT uid");
  2150. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type in ('fancha','FC')")->count("DISTINCT uid");
  2151. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type in ('fancha','FC')")->count("DISTINCT uid");
  2152. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type in ('fancha','FC')")->count("DISTINCT uid");
  2153. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type in ('fancha','FC')")->sum('coins'):'0';
  2154. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type in ('fancha','FC')")->sum('coins'):'0';
  2155. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type in ('fancha','FC')")->sum('coins'):'0';
  2156. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type in ('fancha','FC')")->sum('coins'):'0';
  2157. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type in ('fancha','FC')")->sum('coins'):'0';
  2158. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type in ('fancha','FC')")->sum('coins')?$pay_list_table->where("time is not null and type in ('fancha','FC')")->sum('coins'):'0';
  2159. if (empty($arrs['jinri_amount'])) {
  2160. $arrs['jinri_amount'] = "0";
  2161. }
  2162. $time_chuo = time();
  2163. $time_data= date("Y-m-d H:i",$time_chuo);
  2164. $arrs['time'] =$time_chuo;
  2165. $arrs['date'] =$time_data;
  2166. M("admin_coins_pay")->where("uploader ='素人反差'")->save($arr);
  2167. M("admin_coins_pay")->where("uploader ='素人反差'")->save($arrs);
  2168. $arr_list = array($arr,$arrs);
  2169. $data['code'] = '200';
  2170. $data['status'] = '1';
  2171. $data['data'] =$arr_list;
  2172. echo json_encode($data);
  2173. }else{
  2174. echo $this->returnData();
  2175. }
  2176. }
  2177. /**
  2178. * 意见反馈列表
  2179. * @param $templateid []
  2180. * @return $type 消息类型
  2181. * 16、反馈回复后,点击可查看问题+反馈内容
  2182. * 12、意见反馈栏目,每条数据增加用户名,用户注册时间,充值金额
  2183. */
  2184. public function fankui_list_show(){
  2185. header('Content-Type:text/json;charset=utf-8');
  2186. header('Access-Control-Allow-Origin:*');
  2187. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2188. header('Access-Control-Allow-Methods:POST');
  2189. header('Access-Control-Expose-Headers:*');
  2190. if (!empty($_POST)) {
  2191. $token = $_POST['token']; //b8e3bb6ef8747d7
  2192. if ($token != 'b8e3bb6ef8747d7') {
  2193. $data['code'] = '203';
  2194. $data['msg'] = 'token错误';
  2195. echo json_encode($data);
  2196. die;
  2197. }
  2198. $page = $_POST['page'];
  2199. $size = $_POST['size'];
  2200. $fankui_list = M("user_fankui")->where("id >0")->field("id,uid,user_content,user_date,type,admin_content,admin_date,user_name,zhuce_time")->page($page, $size)->order("id desc")->select();
  2201. foreach ($fankui_list as $key => $value) {
  2202. # code...
  2203. $uid = $value['uid'];
  2204. $fankui_list[$key]['all_pay']=M("huidiao_test")->where("uid=$uid")->sum('amount');;
  2205. if (empty( $fankui_list[$key]['all_pay'])) {
  2206. $fankui_list[$key]['all_pay'] = "0";
  2207. }
  2208. }
  2209. $all_fankui_count = M("user_fankui")->where("id >0")->count();
  2210. if ($fankui_list) {
  2211. $data['code'] = '200';
  2212. $data['status'] = '1';
  2213. $data['message'] = 'ok';
  2214. $data['data'] =$fankui_list;
  2215. $data['all_count'] =$all_fankui_count;
  2216. echo json_encode($data);
  2217. }else{
  2218. $data['code'] = '200';
  2219. $data['status'] = '1';
  2220. $data['message'] = 'null';
  2221. $data['data'] =array();
  2222. $data['all_count'] =$all_fankui_count;
  2223. echo json_encode($data);
  2224. }
  2225. }else{
  2226. echo $this->returnData();
  2227. }
  2228. }
  2229. /**
  2230. * 回复
  2231. * @param $templateid []
  2232. * @return $type 消息类型
  2233. */
  2234. public function huifu_user_fankui(){
  2235. header('Content-Type:text/json;charset=utf-8');
  2236. header('Access-Control-Allow-Origin:*');
  2237. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2238. header('Access-Control-Allow-Methods:POST');
  2239. header('Access-Control-Expose-Headers:*');
  2240. if (!empty($_POST)){
  2241. $token = $_POST['token']; //b8e3bb6ef8747d7
  2242. if ($token != 'b8e3bb6ef8747d7') {
  2243. $data['code'] = '203';
  2244. $data['msg'] = 'token错误';
  2245. echo json_encode($data);
  2246. die;
  2247. }
  2248. $id = $_POST['id'];
  2249. $admin_content = $_POST['admin_content'];
  2250. $time_chuo = time();
  2251. $time_data= date("Y-m-d H:i",$time_chuo);
  2252. $fankui_info['admin_content'] = $admin_content;
  2253. $fankui_info['admin_date'] = $time_data;
  2254. $fankui_info['admin_time'] = $time_chuo;
  2255. $fankui_info['type']=2;
  2256. $admin_huifu =M("user_fankui")->where("id=$id")->save($fankui_info);
  2257. if ($admin_huifu) {
  2258. $data['code'] = '200';
  2259. $data['status'] = '1';
  2260. $data['message'] = 'ok';
  2261. echo json_encode($data);
  2262. }else{
  2263. $data['code'] = '200';
  2264. $data['status'] = '2';
  2265. $data['message'] = 'error';
  2266. echo json_encode($data);
  2267. }
  2268. }else{
  2269. echo $this->returnData();
  2270. }
  2271. }
  2272. /**
  2273. * SMshuju
  2274. * @param $templateid []
  2275. * @return $type 消息类型
  2276. */
  2277. public function sm_shuju(){
  2278. header('Content-Type:text/json;charset=utf-8');
  2279. header('Access-Control-Allow-Origin:*');
  2280. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2281. header('Access-Control-Allow-Methods:POST');
  2282. header('Access-Control-Expose-Headers:*');
  2283. if (!empty($_POST)){
  2284. $token = $_POST['token']; //b8e3bb6ef8747d7
  2285. if ($token != 'b8e3bb6ef8747d7') {
  2286. $data['code'] = '203';
  2287. $data['msg'] = 'token错误';
  2288. echo json_encode($data);
  2289. die;
  2290. }
  2291. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2292. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2293. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2294. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2295. $todayTimestamp = time(); // 获取当前时间戳
  2296. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2297. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2298. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2299. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2300. $zhou_end_time = time();
  2301. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2302. $yue_end_time = time();
  2303. $pay_list_table = M('hj_fc_buy_record');
  2304. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='sm'")->count("DISTINCT uid");
  2305. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='sm'")->count("DISTINCT uid");
  2306. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='sm'")->count("DISTINCT uid");
  2307. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='sm'")->count("DISTINCT uid");
  2308. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='sm'")->count("DISTINCT uid");
  2309. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='sm'")->count("DISTINCT uid");
  2310. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='sm'")->sum('coins'):'0';
  2311. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='sm'")->sum('coins'):'0';
  2312. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='sm'")->sum('coins'):'0';
  2313. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='sm'")->sum('coins'):'0';
  2314. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='sm'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='sm'")->sum('coins'):'0';
  2315. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='sm'")->sum('coins')?$pay_list_table->where("time is not null and type='sm'")->sum('coins'):'0';
  2316. if (empty($arrs['jinri_amount'])) {
  2317. $arrs['jinri_amount'] = "0";
  2318. }
  2319. if (empty($arrs['zuori_amount'])) {
  2320. $arrs['zuori_amount']= "0";
  2321. }
  2322. if (empty( $arrs['sanri_amount'] )) {
  2323. $arrs['sanri_amount'] = "0";
  2324. }
  2325. if (empty($arrs['zhou_amount'])) {
  2326. $arrs['zhou_amount']= "0";
  2327. }
  2328. if (empty($arrs['yue_amount'])) {
  2329. $arrs['yue_amount'] = "0";
  2330. }
  2331. if (empty($arrs['jilei_amount'] )) {
  2332. $arrs['jilei_amount'] = "0";
  2333. }
  2334. $arr_list = array($arr,$arrs);
  2335. $data['code'] = '200';
  2336. $data['status'] = '1';
  2337. $data['data'] =$arr_list;
  2338. echo json_encode($data);
  2339. }else{
  2340. echo $this->returnData();
  2341. }
  2342. }
  2343. /**
  2344. * wanoushuju
  2345. * @param $templateid []
  2346. * @return $type 消息类型
  2347. */
  2348. public function wanou_shuju(){
  2349. header('Content-Type:text/json;charset=utf-8');
  2350. header('Access-Control-Allow-Origin:*');
  2351. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2352. header('Access-Control-Allow-Methods:POST');
  2353. header('Access-Control-Expose-Headers:*');
  2354. if (!empty($_POST)){
  2355. $token = $_POST['token']; //b8e3bb6ef8747d7
  2356. if ($token != 'b8e3bb6ef8747d7') {
  2357. $data['code'] = '203';
  2358. $data['msg'] = 'token错误';
  2359. echo json_encode($data);
  2360. die;
  2361. }
  2362. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2363. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2364. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2365. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2366. $todayTimestamp = time(); // 获取当前时间戳
  2367. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2368. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2369. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2370. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2371. $zhou_end_time = time();
  2372. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2373. $yue_end_time = time();
  2374. $pay_list_table = M('hj_fc_buy_record');
  2375. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wanou' ")->count("DISTINCT uid");
  2376. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wanou'")->count("DISTINCT uid");
  2377. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wanou'")->count("DISTINCT uid");
  2378. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wanou' ")->count("DISTINCT uid");
  2379. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wanou'")->count("DISTINCT uid");
  2380. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='wanou'")->count("DISTINCT uid");
  2381. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wanou'")->sum('coins'):'0';
  2382. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wanou'")->sum('coins'):'0';
  2383. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wanou'")->sum('coins'):'0';
  2384. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wanou'")->sum('coins'):'0';
  2385. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wanou'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wanou'")->sum('coins'):'0';
  2386. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='wanou'")->sum('coins')?$pay_list_table->where("time is not null and type='wanou'")->sum('coins'):'0';
  2387. if (empty($arrs['jinri_amount'])) {
  2388. $arrs['jinri_amount'] = "0";
  2389. }
  2390. if (empty($arrs['zuori_amount'])) {
  2391. $arrs['zuori_amount']= "0";
  2392. }
  2393. if (empty( $arrs['sanri_amount'] )) {
  2394. $arrs['sanri_amount'] = "0";
  2395. }
  2396. if (empty($arrs['zhou_amount'])) {
  2397. $arrs['zhou_amount']= "0";
  2398. }
  2399. if (empty($arrs['yue_amount'])) {
  2400. $arrs['yue_amount'] = "0";
  2401. }
  2402. if (empty($arrs['jilei_amount'] )) {
  2403. $arrs['jilei_amount'] = "0";
  2404. }
  2405. $arr_list = array($arr,$arrs);
  2406. $data['code'] = '200';
  2407. $data['status'] = '1';
  2408. $data['data'] =$arr_list;
  2409. echo json_encode($data);
  2410. }else{
  2411. echo $this->returnData();
  2412. }
  2413. }
  2414. /**
  2415. * avjieshuoshuju
  2416. * AV解说
  2417. * @param $templateid []
  2418. * @return $type 消息类型
  2419. */
  2420. public function avjieshuo_shuju(){
  2421. header('Content-Type:text/json;charset=utf-8');
  2422. header('Access-Control-Allow-Origin:*');
  2423. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2424. header('Access-Control-Allow-Methods:POST');
  2425. header('Access-Control-Expose-Headers:*');
  2426. if (!empty($_POST)){
  2427. $token = $_POST['token']; //b8e3bb6ef8747d7
  2428. if ($token != 'b8e3bb6ef8747d7') {
  2429. $data['code'] = '203';
  2430. $data['msg'] = 'token错误';
  2431. echo json_encode($data);
  2432. die;
  2433. }
  2434. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2435. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2436. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2437. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2438. $todayTimestamp = time(); // 获取当前时间戳
  2439. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2440. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2441. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2442. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2443. $zhou_end_time = time();
  2444. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2445. $yue_end_time = time();
  2446. $pay_list_table = M('hj_fc_buy_record');
  2447. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='av'")->count("DISTINCT uid");
  2448. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='av'")->count("DISTINCT uid");
  2449. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='av'")->count("DISTINCT uid");
  2450. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='av'")->count("DISTINCT uid");
  2451. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='av'")->count("DISTINCT uid");
  2452. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='av'")->count("DISTINCT uid");
  2453. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='av'")->sum('coins'):'0';
  2454. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='av'")->sum('coins'):'0';
  2455. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='av'")->sum('coins'):'0';
  2456. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='av'")->sum('coins'):'0';
  2457. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='av'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='av'")->sum('coins'):'0';
  2458. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='av'")->sum('coins')?$pay_list_table->where("time is not null and type='av'")->sum('coins'):'0';
  2459. if (empty($arrs['jinri_amount'])) {
  2460. $arrs['jinri_amount'] = "0";
  2461. }
  2462. if (empty($arrs['zuori_amount'])) {
  2463. $arrs['zuori_amount']= "0";
  2464. }
  2465. if (empty( $arrs['sanri_amount'] )) {
  2466. $arrs['sanri_amount'] = "0";
  2467. }
  2468. if (empty($arrs['zhou_amount'])) {
  2469. $arrs['zhou_amount']= "0";
  2470. }
  2471. if (empty($arrs['yue_amount'])) {
  2472. $arrs['yue_amount'] = "0";
  2473. }
  2474. if (empty($arrs['jilei_amount'] )) {
  2475. $arrs['jilei_amount'] = "0";
  2476. }
  2477. $time_chuo = time();
  2478. $time_data= date("Y-m-d H:i",$time_chuo);
  2479. $arrs['time'] =$time_chuo;
  2480. $arrs['date'] =$time_data;
  2481. M("admin_coins_pay")->where("uploader ='AV解说'")->save($arr);
  2482. M("admin_coins_pay")->where("uploader ='AV解说'")->save($arrs);
  2483. $arr_list = array($arr,$arrs);
  2484. $data['code'] = '200';
  2485. $data['status'] = '1';
  2486. $data['data'] =$arr_list;
  2487. echo json_encode($data);
  2488. }else{
  2489. echo $this->returnData();
  2490. }
  2491. }
  2492. /**
  2493. * avjieshuoshuju
  2494. * 网曝门
  2495. * @param $templateid []
  2496. * @return $type 消息类型
  2497. */
  2498. public function wangbao_shuju(){
  2499. header('Content-Type:text/json;charset=utf-8');
  2500. header('Access-Control-Allow-Origin:*');
  2501. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2502. header('Access-Control-Allow-Methods:POST');
  2503. header('Access-Control-Expose-Headers:*');
  2504. if (!empty($_POST)){
  2505. $token = $_POST['token']; //b8e3bb6ef8747d7
  2506. if ($token != 'b8e3bb6ef8747d7') {
  2507. $data['code'] = '203';
  2508. $data['msg'] = 'token错误';
  2509. echo json_encode($data);
  2510. die;
  2511. }
  2512. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2513. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2514. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2515. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2516. $todayTimestamp = time(); // 获取当前时间戳
  2517. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2518. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2519. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2520. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2521. $zhou_end_time = time();
  2522. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2523. $yue_end_time = time();
  2524. $pay_list_table = M('hj_fc_buy_record');
  2525. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wangbao'")->count("DISTINCT uid");
  2526. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wangbao'")->count("DISTINCT uid");
  2527. echo PHP_EOL.M("hj_fc_buy_record")->_sql();
  2528. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wangbao'")->count("DISTINCT uid");
  2529. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wangbao'")->count("DISTINCT uid");
  2530. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wangbao'")->count("DISTINCT uid");
  2531. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='wangbao'")->count("DISTINCT uid");
  2532. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='wangbao'")->sum('coins'):'0';
  2533. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='wangbao'")->sum('coins'):'0';
  2534. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='wangbao'")->sum('coins'):'0';
  2535. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='wangbao'")->sum('coins'):'0';
  2536. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wangbao'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='wangbao'")->sum('coins'):'0';
  2537. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='wangbao'")->sum('coins')?$pay_list_table->where("time is not null and type='wangbao'")->sum('coins'):'0';
  2538. if (empty($arrs['jinri_amount'])) {
  2539. $arrs['jinri_amount'] = "0";
  2540. }
  2541. if (empty($arrs['zuori_amount'])) {
  2542. $arrs['zuori_amount']= "0";
  2543. }
  2544. if (empty( $arrs['sanri_amount'] )) {
  2545. $arrs['sanri_amount'] = "0";
  2546. }
  2547. if (empty($arrs['zhou_amount'])) {
  2548. $arrs['zhou_amount']= "0";
  2549. }
  2550. if (empty($arrs['yue_amount'])) {
  2551. $arrs['yue_amount'] = "0";
  2552. }
  2553. if (empty($arrs['jilei_amount'] )) {
  2554. $arrs['jilei_amount'] = "0";
  2555. }
  2556. $time_chuo = time();
  2557. $time_data= date("Y-m-d H:i",$time_chuo);
  2558. $arrs['time'] =$time_chuo;
  2559. $arrs['date'] =$time_data;
  2560. M("admin_coins_pay")->where("uploader ='网曝门'")->save($arr);
  2561. M("admin_coins_pay")->where("uploader ='网曝门'")->save($arrs);
  2562. $arr_list = array($arr,$arrs);
  2563. $data['code'] = '200';
  2564. $data['status'] = '1';
  2565. $data['data'] =$arr_list;
  2566. echo json_encode($data);
  2567. }else{
  2568. echo $this->returnData();
  2569. }
  2570. }
  2571. /**
  2572. * avjieshuoshuju
  2573. * 厕所偷拍
  2574. * @param $templateid []
  2575. * @return $type 消息类型
  2576. */
  2577. public function cesuo_shuju(){
  2578. header('Content-Type:text/json;charset=utf-8');
  2579. header('Access-Control-Allow-Origin:*');
  2580. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2581. header('Access-Control-Allow-Methods:POST');
  2582. header('Access-Control-Expose-Headers:*');
  2583. if (!empty($_POST)){
  2584. $token = $_POST['token']; //b8e3bb6ef8747d7
  2585. if ($token != 'b8e3bb6ef8747d7') {
  2586. $data['code'] = '203';
  2587. $data['msg'] = 'token错误';
  2588. echo json_encode($data);
  2589. die;
  2590. }
  2591. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2592. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2593. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2594. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2595. $todayTimestamp = time(); // 获取当前时间戳
  2596. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2597. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2598. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2599. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2600. $zhou_end_time = time();
  2601. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2602. $yue_end_time = time();
  2603. $pay_list_table = M('hj_fc_buy_record');
  2604. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='cesuo'")->count("DISTINCT uid");
  2605. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='cesuo'")->count("DISTINCT uid");
  2606. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='cesuo'")->count("DISTINCT uid");
  2607. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='cesuo'")->count("DISTINCT uid");
  2608. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='cesuo'")->count("DISTINCT uid");
  2609. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='cesuo'")->count("DISTINCT uid");
  2610. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='cesuo'")->sum('coins'):'0';
  2611. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='cesuo'")->sum('coins'):'0';
  2612. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='cesuo'")->sum('coins'):'0';
  2613. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='cesuo'")->sum('coins'):'0';
  2614. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='cesuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='cesuo'")->sum('coins'):'0';
  2615. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='cesuo'")->sum('coins')?$pay_list_table->where("time is not null and type='cesuo'")->sum('coins'):'0';
  2616. if (empty($arrs['jinri_amount'])) {
  2617. $arrs['jinri_amount'] = "0";
  2618. }
  2619. if (empty($arrs['zuori_amount'])) {
  2620. $arrs['zuori_amount']= "0";
  2621. }
  2622. if (empty( $arrs['sanri_amount'] )) {
  2623. $arrs['sanri_amount'] = "0";
  2624. }
  2625. if (empty($arrs['zhou_amount'])) {
  2626. $arrs['zhou_amount']= "0";
  2627. }
  2628. if (empty($arrs['yue_amount'])) {
  2629. $arrs['yue_amount'] = "0";
  2630. }
  2631. if (empty($arrs['jilei_amount'] )) {
  2632. $arrs['jilei_amount'] = "0";
  2633. }
  2634. $time_chuo = time();
  2635. $time_data= date("Y-m-d H:i",$time_chuo);
  2636. $arrs['time'] =$time_chuo;
  2637. $arrs['date'] =$time_data;
  2638. M("admin_coins_pay")->where("uploader ='厕所偷拍'")->save($arr);
  2639. M("admin_coins_pay")->where("uploader ='厕所偷拍'")->save($arrs);
  2640. $arr_list = array($arr,$arrs);
  2641. $data['code'] = '200';
  2642. $data['status'] = '1';
  2643. $data['data'] =$arr_list;
  2644. echo json_encode($data);
  2645. }else{
  2646. echo $this->returnData();
  2647. }
  2648. }
  2649. /**
  2650. * tianmeiluolishuju
  2651. * @param $templateid []
  2652. * @return $type 消息类型
  2653. * 抄底偷拍
  2654. */
  2655. public function chaodi_shuju(){
  2656. header('Content-Type:text/json;charset=utf-8');
  2657. header('Access-Control-Allow-Origin:*');
  2658. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2659. header('Access-Control-Allow-Methods:POST');
  2660. header('Access-Control-Expose-Headers:*');
  2661. if (!empty($_POST)){
  2662. $token = $_POST['token']; //b8e3bb6ef8747d7
  2663. if ($token != 'b8e3bb6ef8747d7') {
  2664. $data['code'] = '203';
  2665. $data['msg'] = 'token错误';
  2666. echo json_encode($data);
  2667. die;
  2668. }
  2669. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2670. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2671. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2672. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2673. $todayTimestamp = time(); // 获取当前时间戳
  2674. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2675. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2676. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2677. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2678. $zhou_end_time = time();
  2679. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2680. $yue_end_time = time();
  2681. $pay_list_table = M('hj_fc_buy_record');
  2682. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='chaodi' ")->count("DISTINCT uid");
  2683. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='chaodi'")->count("DISTINCT uid");
  2684. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='chaodi'")->count("DISTINCT uid");
  2685. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='chaodi'")->count("DISTINCT uid");
  2686. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='chaodi'")->count("DISTINCT uid");
  2687. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='chaodi'")->count("DISTINCT uid");
  2688. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='chaodi'")->sum('coins'):'0';
  2689. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='chaodi'")->sum('coins'):'0';
  2690. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='chaodi'")->sum('coins'):'0';
  2691. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='chaodi'")->sum('coins'):'0';
  2692. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='chaodi'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='chaodi'")->sum('coins'):'0';
  2693. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='chaodi'")->sum('coins')?$pay_list_table->where("time is not null and type='chaodi'")->sum('coins'):'0';
  2694. if (empty($arrs['jinri_amount'])) {
  2695. $arrs['jinri_amount'] = "0";
  2696. }
  2697. if (empty($arrs['zuori_amount'])) {
  2698. $arrs['zuori_amount']= "0";
  2699. }
  2700. if (empty( $arrs['sanri_amount'] )) {
  2701. $arrs['sanri_amount'] = "0";
  2702. }
  2703. if (empty($arrs['zhou_amount'])) {
  2704. $arrs['zhou_amount']= "0";
  2705. }
  2706. if (empty($arrs['yue_amount'])) {
  2707. $arrs['yue_amount'] = "0";
  2708. }
  2709. if (empty($arrs['jilei_amount'] )) {
  2710. $arrs['jilei_amount'] = "0";
  2711. }
  2712. $time_chuo = time();
  2713. $time_data= date("Y-m-d H:i",$time_chuo);
  2714. $arrs['time'] =$time_chuo;
  2715. $arrs['date'] =$time_data;
  2716. M("admin_coins_pay")->where("uploader ='抄底偷拍'")->save($arr);
  2717. M("admin_coins_pay")->where("uploader ='抄底偷拍'")->save($arrs);
  2718. $arr_list = array($arr,$arrs);
  2719. $data['code'] = '200';
  2720. $data['status'] = '1';
  2721. $data['data'] =$arr_list;
  2722. echo json_encode($data);
  2723. }else{
  2724. echo $this->returnData();
  2725. }
  2726. }
  2727. /**
  2728. * tianmeiluolishuju
  2729. * @param $templateid []
  2730. * @return $type 消息类型
  2731. * 粉嫩少女
  2732. */
  2733. public function fennen_shuju(){
  2734. header('Content-Type:text/json;charset=utf-8');
  2735. header('Access-Control-Allow-Origin:*');
  2736. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2737. header('Access-Control-Allow-Methods:POST');
  2738. header('Access-Control-Expose-Headers:*');
  2739. if (!empty($_POST)){
  2740. $token = $_POST['token']; //b8e3bb6ef8747d7
  2741. if ($token != 'b8e3bb6ef8747d7') {
  2742. $data['code'] = '203';
  2743. $data['msg'] = 'token错误';
  2744. echo json_encode($data);
  2745. die;
  2746. }
  2747. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2748. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2749. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2750. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2751. $todayTimestamp = time(); // 获取当前时间戳
  2752. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2753. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2754. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2755. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2756. $zhou_end_time = time();
  2757. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2758. $yue_end_time = time();
  2759. $pay_list_table = M('hj_fc_buy_record');
  2760. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='luoli' ")->count("DISTINCT uid");
  2761. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='luoli'")->count("DISTINCT uid");
  2762. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='luoli'")->count("DISTINCT uid");
  2763. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='luoli'")->count("DISTINCT uid");
  2764. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='luoli'")->count("DISTINCT uid");
  2765. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='luoli'")->count("DISTINCT uid");
  2766. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='luoli'")->sum('coins'):'0';
  2767. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='luoli'")->sum('coins'):'0';
  2768. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='luoli'")->sum('coins'):'0';
  2769. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='luoli'")->sum('coins'):'0';
  2770. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='luoli'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='luoli'")->sum('coins'):'0';
  2771. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='luoli'")->sum('coins')?$pay_list_table->where("time is not null and type='luoli'")->sum('coins'):'0';
  2772. if (empty($arrs['jinri_amount'])) {
  2773. $arrs['jinri_amount'] = "0";
  2774. }
  2775. if (empty($arrs['zuori_amount'])) {
  2776. $arrs['zuori_amount']= "0";
  2777. }
  2778. if (empty( $arrs['sanri_amount'] )) {
  2779. $arrs['sanri_amount'] = "0";
  2780. }
  2781. if (empty($arrs['zhou_amount'])) {
  2782. $arrs['zhou_amount']= "0";
  2783. }
  2784. if (empty($arrs['yue_amount'])) {
  2785. $arrs['yue_amount'] = "0";
  2786. }
  2787. if (empty($arrs['jilei_amount'] )) {
  2788. $arrs['jilei_amount'] = "0";
  2789. }
  2790. $time_chuo = time();
  2791. $time_data= date("Y-m-d H:i",$time_chuo);
  2792. $arrs['time'] =$time_chuo;
  2793. $arrs['date'] =$time_data;
  2794. M("admin_coins_pay")->where("uploader ='粉嫩少女'")->save($arr);
  2795. M("admin_coins_pay")->where("uploader ='粉嫩少女'")->save($arrs);
  2796. $arr_list = array($arr,$arrs);
  2797. $data['code'] = '200';
  2798. $data['status'] = '1';
  2799. $data['data'] =$arr_list;
  2800. echo json_encode($data);
  2801. }else{
  2802. echo $this->returnData();
  2803. }
  2804. }
  2805. /**
  2806. * tianmeiluolishuju
  2807. * 顶臀街射
  2808. * @param $templateid []
  2809. * @return $type 消息类型
  2810. * 顶臀街射
  2811. */
  2812. public function dingtun_shuju(){
  2813. header('Content-Type:text/json;charset=utf-8');
  2814. header('Access-Control-Allow-Origin:*');
  2815. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2816. header('Access-Control-Allow-Methods:POST');
  2817. header('Access-Control-Expose-Headers:*');
  2818. if (!empty($_POST)){
  2819. $token = $_POST['token']; //b8e3bb6ef8747d7
  2820. if ($token != 'b8e3bb6ef8747d7') {
  2821. $data['code'] = '203';
  2822. $data['msg'] = 'token错误';
  2823. echo json_encode($data);
  2824. die;
  2825. }
  2826. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2827. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2828. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2829. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2830. $todayTimestamp = time(); // 获取当前时间戳
  2831. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2832. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2833. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2834. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2835. $zhou_end_time = time();
  2836. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2837. $yue_end_time = time();
  2838. $pay_list_table = M('hj_fc_buy_record');
  2839. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='dingtun' ")->count("DISTINCT uid");
  2840. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='dingtun'")->count("DISTINCT uid");
  2841. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='dingtun'")->count("DISTINCT uid");
  2842. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='dingtun'")->count("DISTINCT uid");
  2843. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='dingtun'")->count("DISTINCT uid");
  2844. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='dingtun'")->count("DISTINCT uid");
  2845. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='dingtun'")->sum('coins'):'0';
  2846. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='dingtun'")->sum('coins'):'0';
  2847. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='dingtun'")->sum('coins'):'0';
  2848. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='dingtun'")->sum('coins'):'0';
  2849. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='dingtun'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='dingtun'")->sum('coins'):'0';
  2850. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='dingtun'")->sum('coins')?$pay_list_table->where("time is not null and type='dingtun'")->sum('coins'):'0';
  2851. if (empty($arrs['jinri_amount'])) {
  2852. $arrs['jinri_amount'] = "0";
  2853. }
  2854. if (empty($arrs['zuori_amount'])) {
  2855. $arrs['zuori_amount']= "0";
  2856. }
  2857. if (empty( $arrs['sanri_amount'] )) {
  2858. $arrs['sanri_amount'] = "0";
  2859. }
  2860. if (empty($arrs['zhou_amount'])) {
  2861. $arrs['zhou_amount']= "0";
  2862. }
  2863. if (empty($arrs['yue_amount'])) {
  2864. $arrs['yue_amount'] = "0";
  2865. }
  2866. if (empty($arrs['jilei_amount'] )) {
  2867. $arrs['jilei_amount'] = "0";
  2868. }
  2869. $time_chuo = time();
  2870. $time_data= date("Y-m-d H:i",$time_chuo);
  2871. $arrs['time'] =$time_chuo;
  2872. $arrs['date'] =$time_data;
  2873. M("admin_coins_pay")->where("uploader ='顶臀街射'")->save($arr);
  2874. M("admin_coins_pay")->where("uploader ='顶臀街射'")->save($arrs);
  2875. $arr_list = array($arr,$arrs);
  2876. $data['code'] = '200';
  2877. $data['status'] = '1';
  2878. $data['data'] =$arr_list;
  2879. echo json_encode($data);
  2880. }else{
  2881. echo $this->returnData();
  2882. }
  2883. }
  2884. /**
  2885. * tianmeiluolishuju
  2886. * @param $templateid []
  2887. * @return $type 消息类型
  2888. * 色情小说
  2889. */
  2890. public function xiaoshuo_shuju(){
  2891. header('Content-Type:text/json;charset=utf-8');
  2892. header('Access-Control-Allow-Origin:*');
  2893. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2894. header('Access-Control-Allow-Methods:POST');
  2895. header('Access-Control-Expose-Headers:*');
  2896. if (!empty($_POST)){
  2897. $token = $_POST['token']; //b8e3bb6ef8747d7
  2898. if ($token != 'b8e3bb6ef8747d7') {
  2899. $data['code'] = '203';
  2900. $data['msg'] = 'token错误';
  2901. echo json_encode($data);
  2902. die;
  2903. }
  2904. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2905. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2906. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2907. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2908. $todayTimestamp = time(); // 获取当前时间戳
  2909. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2910. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2911. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2912. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2913. $zhou_end_time = time();
  2914. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2915. $yue_end_time = time();
  2916. $pay_list_table = M('hj_fc_buy_record');
  2917. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='xiaoshuo' ")->count("DISTINCT uid");
  2918. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='xiaoshuo'")->count("DISTINCT uid");
  2919. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='xiaoshuo'")->count("DISTINCT uid");
  2920. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='xiaoshuo'")->count("DISTINCT uid");
  2921. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='xiaoshuo'")->count("DISTINCT uid");
  2922. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='xiaoshuo'")->count("DISTINCT uid");
  2923. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='xiaoshuo'")->sum('coins'):'0';
  2924. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='xiaoshuo'")->sum('coins'):'0';
  2925. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='xiaoshuo'")->sum('coins'):'0';
  2926. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='xiaoshuo'")->sum('coins'):'0';
  2927. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='xiaoshuo'")->sum('coins'):'0';
  2928. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='xiaoshuo'")->sum('coins')?$pay_list_table->where("time is not null and type='xiaoshuo'")->sum('coins'):'0';
  2929. if (empty($arrs['jinri_amount'])) {
  2930. $arrs['jinri_amount'] = "0";
  2931. }
  2932. if (empty($arrs['zuori_amount'])) {
  2933. $arrs['zuori_amount']= "0";
  2934. }
  2935. if (empty( $arrs['sanri_amount'] )) {
  2936. $arrs['sanri_amount'] = "0";
  2937. }
  2938. if (empty($arrs['zhou_amount'])) {
  2939. $arrs['zhou_amount']= "0";
  2940. }
  2941. if (empty($arrs['yue_amount'])) {
  2942. $arrs['yue_amount'] = "0";
  2943. }
  2944. if (empty($arrs['jilei_amount'] )) {
  2945. $arrs['jilei_amount'] = "0";
  2946. }
  2947. $time_chuo = time();
  2948. $time_data= date("Y-m-d H:i",$time_chuo);
  2949. $arrs['time'] =$time_chuo;
  2950. $arrs['date'] =$time_data;
  2951. M("admin_coins_pay")->where("uploader ='色情小说'")->save($arr);
  2952. M("admin_coins_pay")->where("uploader ='色情小说'")->save($arrs);
  2953. $arr_list = array($arr,$arrs);
  2954. $data['code'] = '200';
  2955. $data['status'] = '1';
  2956. $data['data'] =$arr_list;
  2957. echo json_encode($data);
  2958. }else{
  2959. echo $this->returnData();
  2960. }
  2961. }
  2962. /**
  2963. * tianmeiluolishuju
  2964. * @param $templateid []
  2965. * @return $type 消息类型
  2966. * 另类猎奇
  2967. */
  2968. public function lieqi_shuju(){
  2969. header('Content-Type:text/json;charset=utf-8');
  2970. header('Access-Control-Allow-Origin:*');
  2971. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  2972. header('Access-Control-Allow-Methods:POST');
  2973. header('Access-Control-Expose-Headers:*');
  2974. if (!empty($_POST)){
  2975. $token = $_POST['token']; //b8e3bb6ef8747d7
  2976. if ($token != 'b8e3bb6ef8747d7') {
  2977. $data['code'] = '203';
  2978. $data['msg'] = 'token错误';
  2979. echo json_encode($data);
  2980. die;
  2981. }
  2982. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  2983. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  2984. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  2985. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  2986. $todayTimestamp = time(); // 获取当前时间戳
  2987. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  2988. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  2989. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  2990. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  2991. $zhou_end_time = time();
  2992. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  2993. $yue_end_time = time();
  2994. $pay_list_table = M('hj_fc_buy_record');
  2995. $arr['jinri_pay_num'] = $pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='lieqi' ")->count("DISTINCT uid");
  2996. $arr['zuori_pay_num'] = $pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='lieqi'")->count("DISTINCT uid");
  2997. $arr['sanri_pay_num'] = $pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='lieqi'")->count("DISTINCT uid");
  2998. $arr['zhou_pay_num'] = $pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='lieqi'")->count("DISTINCT uid");
  2999. $arr['yue_pay_num'] = $pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='lieqi'")->count("DISTINCT uid");
  3000. $arr['jilei_pay_num'] = $pay_list_table->where("id>0 and type='lieqi'")->count("DISTINCT uid");
  3001. $arrs['jinri_amount'] =$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $jinri_start_time and $jinri_end_time and type='lieqi'")->sum('coins'):'0';
  3002. $arrs['zuori_amount'] =$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $zuo_start_time and $zuo_end_time and type='lieqi'")->sum('coins'):'0';
  3003. $arrs['sanri_amount'] =$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $san_start_time and $san_end_time and type='lieqi'")->sum('coins'):'0';
  3004. $arrs['zhou_amount'] =$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $zhou_start_time and $zhou_end_time and type='lieqi'")->sum('coins'):'0';
  3005. $arrs['yue_amount'] =$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='lieqi'")->sum('coins')?$pay_list_table->where("time BETWEEN $yue_start_time and $yue_end_time and type='lieqi'")->sum('coins'):'0';
  3006. $arrs['jilei_amount'] =$pay_list_table->where("time is not null and type='lieqi'")->sum('coins')?$pay_list_table->where("time is not null and type='lieqi'")->sum('coins'):'0';
  3007. if (empty($arrs['jinri_amount'])) {
  3008. $arrs['jinri_amount'] = "0";
  3009. }
  3010. if (empty($arrs['zuori_amount'])) {
  3011. $arrs['zuori_amount']= "0";
  3012. }
  3013. if (empty( $arrs['sanri_amount'] )) {
  3014. $arrs['sanri_amount'] = "0";
  3015. }
  3016. if (empty($arrs['zhou_amount'])) {
  3017. $arrs['zhou_amount']= "0";
  3018. }
  3019. if (empty($arrs['yue_amount'])) {
  3020. $arrs['yue_amount'] = "0";
  3021. }
  3022. if (empty($arrs['jilei_amount'] )) {
  3023. $arrs['jilei_amount'] = "0";
  3024. }
  3025. $time_chuo = time();
  3026. $time_data= date("Y-m-d H:i",$time_chuo);
  3027. $arrs['time'] =$time_chuo;
  3028. $arrs['date'] =$time_data;
  3029. M("admin_coins_pay")->where("uploader ='另类猎奇'")->save($arr);
  3030. M("admin_coins_pay")->where("uploader ='另类猎奇'")->save($arrs);
  3031. $arr_list = array($arr,$arrs);
  3032. $data['code'] = '200';
  3033. $data['status'] = '1';
  3034. $data['data'] =$arr_list;
  3035. echo json_encode($data);
  3036. }else{
  3037. echo $this->returnData();
  3038. }
  3039. }
  3040. /**
  3041. * 版本:1.7
  3042. * 新增/更新:add
  3043. * 简述:look the name
  3044. * @param $templateid []
  3045. * @return $type 消息类型
  3046. */
  3047. public function show_gonggao_list(){
  3048. header('Content-Type:text/json;charset=utf-8');
  3049. header('Access-Control-Allow-Origin:*');
  3050. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3051. header('Access-Control-Allow-Methods:POST');
  3052. header('Access-Control-Expose-Headers:*');
  3053. if (!empty($_POST)){
  3054. $token = $_POST['token'];
  3055. if ($token != 'b8e3bb6ef8747d7') {
  3056. $data['code'] = '203';
  3057. $data['msg'] = 'token错误';
  3058. echo json_encode($data);
  3059. die;
  3060. }
  3061. $all_gonggao = M("gonggao")->where("id>0")->select();
  3062. if ($all_gonggao){
  3063. $data['code'] = '200';
  3064. $data['status'] = '1';
  3065. $data['message'] = 'ok';
  3066. $data['data'] = $all_gonggao;
  3067. echo json_encode($data);
  3068. }else{
  3069. $data['code'] = '201';
  3070. $data['status'] = '1';
  3071. $data['message'] = 'error';
  3072. $data['data'] = array();
  3073. echo json_encode($data);
  3074. }
  3075. }else{
  3076. echo $this->returnData();
  3077. }
  3078. }
  3079. /**
  3080. * 版本:2.37
  3081. * 新增/更新:开启公告按钮
  3082. * 简述:look the name
  3083. * @param $templateid []
  3084. * @return $type 消息类型
  3085. */
  3086. public function on_gonggao_info(){
  3087. header('Content-Type:text/json;charset=utf-8');
  3088. header('Access-Control-Allow-Origin:*');
  3089. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3090. header('Access-Control-Allow-Methods:POST');
  3091. header('Access-Control-Expose-Headers:*');
  3092. if (!empty($_POST)){
  3093. $token = $_POST['token'];
  3094. if ($token != 'b8e3bb6ef8747d7') {
  3095. $data['code'] = '203';
  3096. $data['msg'] = 'token错误';
  3097. echo json_encode($data);
  3098. die;
  3099. }
  3100. $id=$_POST['id'];
  3101. $ret = M("gonggao")->where("id='$id'")->save(array("status_"=>0));
  3102. if ($ret){
  3103. $data['code'] = '200';
  3104. $data['msg'] ="请求成功";
  3105. echo json_encode($data);
  3106. }else{
  3107. $data['code'] = '201';
  3108. $data['msg'] = '请求失败';
  3109. echo json_encode($data);
  3110. }
  3111. }else{
  3112. echo $this->returnData();
  3113. }
  3114. }
  3115. /**
  3116. * 版本:2.37
  3117. * 新增/更新:关闭公告按钮
  3118. * 简述:look the name
  3119. * @param $templateid []
  3120. * @return $type 消息类型
  3121. */
  3122. public function off_gonggao_info(){
  3123. header('Content-Type:text/json;charset=utf-8');
  3124. header('Access-Control-Allow-Origin:*');
  3125. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3126. header('Access-Control-Allow-Methods:POST');
  3127. header('Access-Control-Expose-Headers:*');
  3128. if (!empty($_POST)){
  3129. $token = $_POST['token'];
  3130. if ($token != 'b8e3bb6ef8747d7') {
  3131. $data['code'] = '203';
  3132. $data['msg'] = 'token错误';
  3133. echo json_encode($data);
  3134. die;
  3135. }
  3136. $id=$_POST['id'];
  3137. $ret = M("gonggao")->where("id='$id'")->save(array("status_"=>1));
  3138. if ($ret){
  3139. $data['code'] = '200';
  3140. $data['msg'] ="请求成功";
  3141. echo json_encode($data);
  3142. }else{
  3143. $data['code'] = '201';
  3144. $data['msg'] = '请求失败';
  3145. echo json_encode($data);
  3146. }
  3147. }else{
  3148. echo $this->returnData();
  3149. }
  3150. }
  3151. /**
  3152. * 版本:
  3153. * 新增/更新:
  3154. * 简述:
  3155. * @param $templateid []
  3156. * @return $type 消息类型
  3157. */
  3158. public function admin_conins_video_tongji(){
  3159. header('Content-Type:text/json;charset=utf-8');
  3160. header('Access-Control-Allow-Origin:*');
  3161. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3162. header('Access-Control-Allow-Methods:POST');
  3163. header('Access-Control-Expose-Headers:*');
  3164. if (!empty($_POST)){
  3165. $all_data = M("admin_coins_pay")->where("id>0")->order("id asc")->select();
  3166. $data['code'] = '200';
  3167. $data['status'] = '1';
  3168. $data['message'] = 'ok';
  3169. $data['data'] =$all_data;
  3170. echo json_encode($data);
  3171. }else{
  3172. echo $this->returnData();
  3173. }
  3174. }
  3175. /**
  3176. * 版本:
  3177. * 新增/更新:
  3178. * 简述:
  3179. * @param $templateid []
  3180. * @return $type 消息类型
  3181. */
  3182. public function admin_xiao_yang(){
  3183. header('Content-Type:text/json;charset=utf-8');
  3184. header('Access-Control-Allow-Origin:*');
  3185. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3186. header('Access-Control-Allow-Methods:POST');
  3187. header('Access-Control-Expose-Headers:*');
  3188. $headers = getallheaders();
  3189. $token = $headers['Zidingyii'] ?? null;
  3190. $vid = $headers['Vid'] ?? null;
  3191. $type = $headers['Type'] ?? null;
  3192. $hours_ago = date('Y-m-d H:i:s', time());
  3193. if(empty($token)){
  3194. http_response_code(401);
  3195. die();
  3196. }
  3197. //是否为本系统合法用户
  3198. $uesr = M("user_info")->field("id")->where("token = '$token'and token_time_out >= '$hours_ago' ")->find();
  3199. $check_info = M("token_tmpl")->where("token='$token'")->find();
  3200. //非本系统token
  3201. if(empty($uesr) && empty($check_info)){
  3202. http_response_code(401);
  3203. die();
  3204. }
  3205. //未登录用户,不允许直接播放
  3206. if(!empty($check_info) && empty($uesr) && strtolower($type)=='m3u8'){
  3207. http_response_code(401);
  3208. die();
  3209. }
  3210. //未来,判断用户是否有权限播放播放(未开通的栏目不允许播放)
  3211. if(!empty($uesr) && strtolower($type)=='m3u8')
  3212. {
  3213. if(empty($vid))
  3214. {
  3215. //播放前必须带vid
  3216. //die();
  3217. }
  3218. //vid在库,继续判断用户是否开通了栏目
  3219. }
  3220. }
  3221. /**
  3222. * 版本:
  3223. * 新增/更新:吃瓜统计
  3224. * 简述:
  3225. * @param $templateid []
  3226. * @return $type 消息类型
  3227. */
  3228. public function admin_conins_melon_tongji(){
  3229. header('Content-Type:text/json;charset=utf-8');
  3230. header('Access-Control-Allow-Origin:*');
  3231. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3232. header('Access-Control-Allow-Methods:POST');
  3233. header('Access-Control-Expose-Headers:*');
  3234. if (!empty($_POST)){
  3235. $all_data = M("admin_coins_pay")->where("id>0")->order("sanri_amount desc")->select();
  3236. $uid = M("vip_chigua")->count("uid"); //累计付费人数
  3237. $take_coins = M("vip_chigua")->sum("take_coins"); //累计消费金额
  3238. //今日
  3239. $todaytime = date("Y-m-d ",time())."00:00:00";
  3240. //三日
  3241. $threedaytime = date("Y-m-d ", strtotime("-3 day")) . "00:00:00";
  3242. //周
  3243. $weekdaytime = date("Y-m-d ", strtotime("-1 week")) . "00:00:00";
  3244. //月
  3245. $monthdaytime = date("Y-m-d ", strtotime("-1 month")) . "00:00:00";
  3246. //今日付费金额
  3247. //$todayloginuser = count(M("vip_chigua")->where("time>='$todaytime' and uid!=0")->group("take_coins")->getField("take_coins", true));
  3248. //今日付费金额
  3249. $todayloginuser = M("vip_chigua")->where(" create_at >= '$todaytime' and uid!=0")->sum("take_coins");
  3250. //今日付费人数
  3251. $todaylogicount = M("vip_chigua")->where(" create_at >= '$todaytime' and uid!=0")->count("uid");
  3252. //昨天付费金额
  3253. $yesterdaysum = M("vip_chigua")->where(" TO_DAYS(create_at)=TO_DAYS(NOW()) - 1")->sum("take_coins");
  3254. //昨天付费人数
  3255. $yesterdaycount = M("vip_chigua")->where(" TO_DAYS(create_at)=TO_DAYS(NOW()) - 1")->count("uid");
  3256. //三天付费金额
  3257. $threedaysum = M("vip_chigua")->where(" create_at >= '$threedaytime' and uid!=0")->sum("take_coins");
  3258. //三天付费人数
  3259. $threedaycount = M("vip_chigua")->where(" create_at >= '$threedaytime' and uid!=0")->count("uid");
  3260. //周付费金额
  3261. $weekdaysum = M("vip_chigua")->where(" create_at >= '$weekdaytime' and uid!=0")->sum("take_coins");
  3262. //周付费人数
  3263. $weekdaycount = M("vip_chigua")->where(" create_at >= '$weekdaytime' and uid!=0")->count("uid");
  3264. //月付费金额
  3265. $montsum = M("vip_chigua")->where(" create_at >= '$monthdaytime' and uid!=0")->sum("take_coins");
  3266. //月付费金额
  3267. $montcount = M("vip_chigua")->where(" create_at >= '$monthdaytime' and uid!=0")->count("uid");
  3268. $all["uid"] = $uid;
  3269. $all["take_coins"] = $take_coins;
  3270. $all["todayloginuser"] = $todayloginuser;
  3271. $all["todaylogicount"] = $todaylogicount;
  3272. $all["yesterdaysum"] = $yesterdaysum;
  3273. $all["yesterdaycount"] = $yesterdaycount;
  3274. $all["threedaysum"] = $threedaysum;
  3275. $all["threedaycount"] = $threedaycount;
  3276. $all["weekdaysum"] = $weekdaysum;
  3277. $all["weekdaycount"] = $weekdaycount;
  3278. $all["montsum"] = $montsum;
  3279. $all["montcount"] = $montcount;
  3280. $data['code'] = '200';
  3281. $data['status'] = '1';
  3282. $data['message'] = 'ok';
  3283. $data['data'] =$all;
  3284. echo json_encode($data);
  3285. }else{
  3286. echo $this->returnData();
  3287. }
  3288. }
  3289. /**
  3290. * 版本:
  3291. * 新增/更新:
  3292. * 简述:
  3293. * @param $templateid []
  3294. * @return $type 消息类型
  3295. */
  3296. public function admin_home_show(){
  3297. header('Content-Type:text/json;charset=utf-8');
  3298. header('Access-Control-Allow-Origin:*');
  3299. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3300. header('Access-Control-Allow-Methods:POST');
  3301. header('Access-Control-Expose-Headers:*');
  3302. if (!empty($_POST)){
  3303. $all_data = M("admin_shuju_list")->select();
  3304. $data['code'] = '200';
  3305. $data['status'] = '1';
  3306. $data['message'] = 'ok';
  3307. $data['data'] =$all_data;
  3308. echo json_encode($data);
  3309. }else{
  3310. echo $this->returnData();
  3311. }
  3312. }
  3313. /**
  3314. * 版本:1.7
  3315. * 新增/:新增
  3316. * 简述:更新公告内容
  3317. * @param $templateid []
  3318. * @return $type 消息类型
  3319. */
  3320. public function save_gonggao_content(){
  3321. header('Content-Type:text/json;charset=utf-8');
  3322. header('Access-Control-Allow-Origin:*');
  3323. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3324. header('Access-Control-Allow-Methods:POST');
  3325. header('Access-Control-Expose-Headers:*');
  3326. if (!empty($_POST)){
  3327. $id = $_POST['id'];
  3328. $content = $_POST['content'];
  3329. $yn_save = M("gonggao")->where("id=$id")->save($_POST);
  3330. if ($yn_save){
  3331. $data['code'] = '200';
  3332. $data['status'] = '1';
  3333. $data['message'] = 'save_ok';
  3334. echo json_encode($data);
  3335. }else{
  3336. $data['code'] = '200';
  3337. $data['status'] = '2';
  3338. $data['message'] = 'no_save';
  3339. echo json_encode($data);
  3340. }
  3341. }else{
  3342. echo $this->returnData();
  3343. }
  3344. }
  3345. /**
  3346. * 版本:1.7
  3347. * 新增/更新:新增
  3348. * 简述:启用公告将其他公告关闭
  3349. * @param $templateid []
  3350. * @return $type 消息类型
  3351. */
  3352. public function open_gonggao(){
  3353. header('Content-Type:text/json;charset=utf-8');
  3354. header('Access-Control-Allow-Origin:*');
  3355. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3356. header('Access-Control-Allow-Methods:POST');
  3357. header('Access-Control-Expose-Headers:*');
  3358. if (!empty($_POST)){
  3359. $id= $_POST['id'];
  3360. $zero['type']= 0;
  3361. $one['type']= 1;
  3362. $one_yn = M("gonggao")->where("id=$id")->save($one);
  3363. $zero_yn =M("gonggao")->where("id!=$id")->save($zero);
  3364. if ($one_yn and $zero_yn){
  3365. $data['code'] = '200';
  3366. $data['status'] = '1';
  3367. $data['message'] = 'save_ok';
  3368. echo json_encode($data);
  3369. }else{
  3370. $data['code'] = '200';
  3371. $data['status'] = '2';
  3372. $data['message'] = 'no_save';
  3373. echo json_encode($data);
  3374. }
  3375. }else{
  3376. echo $this->returnData();
  3377. }
  3378. }
  3379. /**
  3380. * 版本:1.7
  3381. * 新增/更新:新增
  3382. * 简述:add gonggao
  3383. * @param $templateid []
  3384. * @return $type 消息类型
  3385. */
  3386. public function add_gonggao(){
  3387. header('Content-Type:text/json;charset=utf-8');
  3388. header('Access-Control-Allow-Origin:*');
  3389. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3390. header('Access-Control-Allow-Methods:POST');
  3391. header('Access-Control-Expose-Headers:*');
  3392. if (!empty($_POST)){
  3393. $content = $_POST['content'];
  3394. $add_yn = M("gonggao")->add($_POST);
  3395. if ($add_yn){
  3396. $data['code'] = '200';
  3397. $data['status'] = '1';
  3398. $data['message'] = 'ok';
  3399. echo json_encode($data);
  3400. }else{
  3401. $data['code'] = '200';
  3402. $data['status'] = '2';
  3403. $data['message'] = 'error';
  3404. echo json_encode($data);
  3405. }
  3406. }else{
  3407. echo $this->returnData();
  3408. }
  3409. }
  3410. /**
  3411. * 版本:1.7
  3412. * 新增/更新:新增
  3413. * 简述:delete gonggao
  3414. * @param $templateid []
  3415. * @return $type 消息类型
  3416. */
  3417. public function delete_gonggao(){
  3418. header('Content-Type:text/json;charset=utf-8');
  3419. header('Access-Control-Allow-Origin:*');
  3420. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3421. header('Access-Control-Allow-Methods:POST');
  3422. header('Access-Control-Expose-Headers:*');
  3423. if (!empty($_POST)){
  3424. $id = $_POST['id'];
  3425. $yn_de = M("gonggao")->where("id=$id")->delete();
  3426. if ($yn_de){
  3427. $data['code'] = '200';
  3428. $data['status'] = '1';
  3429. $data['message'] = 'ok';
  3430. echo json_encode($data);
  3431. }else{
  3432. $data['code'] = '200';
  3433. $data['status'] = '2';
  3434. $data['message'] = 'error';
  3435. echo json_encode($data);
  3436. }
  3437. }else{
  3438. echo $this->returnData();
  3439. }
  3440. }
  3441. /**
  3442. * 版本:
  3443. * 新增/更新:
  3444. * 简述:
  3445. * @param $templateid []
  3446. * @return $type 消息类型
  3447. */
  3448. public function video_count_tongjiss(){
  3449. header('Content-Type:text/json;charset=utf-8');
  3450. header('Access-Control-Allow-Origin:*');
  3451. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3452. header('Access-Control-Allow-Methods:POST');
  3453. header('Access-Control-Expose-Headers:*');
  3454. if (!empty($_POST)){
  3455. $token = $_POST['token'];
  3456. if ($token != 'b8e3bb6ef8747d7') {
  3457. $data['code'] = '203';
  3458. $data['msg'] = 'token错误';
  3459. echo json_encode($data);
  3460. die;
  3461. }
  3462. $page = $_POST['page'];
  3463. $size = $_POST['size'];
  3464. // $type_list_all =array(
  3465. // array('欧美','亚洲','动漫','素人反差'),
  3466. // array('黑料','网爆门','海角乱伦','麻豆传媒'),
  3467. // array('探花大神','SM调教','AI换脸','另类猎奇'),
  3468. // array('雪白美乳','玩偶姐姐','AV解说','甜美萝莉'),
  3469. // );
  3470. $seven_time_chuo = time() - (7 * 24 * 3600);
  3471. switch ($page) {
  3472. case '1':
  3473. $oumei_count = M("video_list_test")->where("id>0 and site='EUA'")->count();
  3474. $asian_count = M("video_list_test")->where("id>0 and site='Asian'")->count();
  3475. $dongman_count = M("video_list_test")->where("id>0 and site='Anime' or site='动画'")->count();
  3476. $fancha_count = M("video_list_test")->where("id>0 and site='FC'")->count();
  3477. $oumei_count_zhou = M("video_list_test")->where("id>0 and site='EUA' and add_time>'$seven_time_chuo'")->count();
  3478. $asian_countzhou = M("video_list_test")->where("id>0 and site='Asian' and add_time>'$seven_time_chuo'")->count();
  3479. $dongman_countzhou = M("video_list_test")->where("id>0 and site in('Anime','动画') and add_time>'$seven_time_chuo'")->count();
  3480. $fancha_countzhou = M("video_list_test")->where("id>0 and site='FC' and add_time>'$seven_time_chuo'")->count();
  3481. $oumei_list= array('name'=>'欧美','zhou'=>"$oumei_count_zhou",'all'=>"$oumei_count");
  3482. $asian_list= array('name'=>'亚洲','zhou'=>"$asian_countzhou",'all'=>"$asian_count");
  3483. $donman_list= array('name'=>'动漫','zhou'=>"$dongman_countzhou",'all'=>"$dongman_count");
  3484. $fancha_list= array('name'=>'反差','zhou'=>"$fancha_countzhou",'all'=>"$fancha_count");
  3485. $data_list = array($oumei_list,$asian_list,$donman_list,$fancha_list);
  3486. break;
  3487. case '2':
  3488. $heiliao = M("video_list_test")->where("id>0 and site='HL'")->count();
  3489. $wangbao = M("video_list_test")->where("id>0 and site='WB'")->count();
  3490. $haijiaoluanlun = M("video_list_test")->where("id>0 and site='HJ'")->count();
  3491. $madou = M("video_list_test")->where("id>0 and site='麻豆传媒'")->count();
  3492. $heiliaozhou = M("video_list_test")->where("id>0 and site='HL' and add_time>'$seven_time_chuo'")->count();
  3493. $wangbaozhou = M("video_list_test")->where("id>0 and site='WB' and add_time>'$seven_time_chuo'")->count();
  3494. $haijiaoluanlunzhou = M("video_list_test")->where("id>0 and site='HJ' and add_time>'$seven_time_chuo'")->count();
  3495. $madouzhou = M("video_list_test")->where("id>0 and site='麻豆传媒' and add_time>'$seven_time_chuo'")->count();
  3496. $oumei_list= array('name'=>'黑料','zhou'=>"$heiliaozhou",'all'=>"$heiliao");
  3497. $asian_list= array('name'=>'网爆门','zhou'=>"$wangbaozhou",'all'=>"$wangbao");
  3498. $donman_list= array('name'=>'海角乱伦','zhou'=>"$haijiaoluanlunzhou",'all'=>"$haijiaoluanlun");
  3499. $fancha_list= array('name'=>'麻豆传媒','zhou'=>"$madouzhou",'all'=>"$madouzhou");
  3500. $data_list = array($oumei_list,$asian_list,$donman_list,$fancha_list);
  3501. break;
  3502. case '3':
  3503. $tanhua = M("video_list_test")->where("id>0 and site='国产探花'")->count();
  3504. $smtiaojiao = M("video_list_test")->where("id>0 and site='SM调教'")->count();
  3505. $aihuanlian = M("video_list_test")->where("id>0 and site='AI'")->count();
  3506. $linglei = M("video_list_test")->where("id>0 and site='孕妇做爱' or site='性感人妖' or site='人兽动物' or site='超级大胆' or site='另类猎奇' or site='同性做爱'")->count();
  3507. $tanhuazhou = M("video_list_test")->where("id>0 and site='国产探花' and add_time>'$seven_time_chuo'")->count();
  3508. $smtiaojiaozhou = M("video_list_test")->where("id>0 and site='SM调教' and add_time>'$seven_time_chuo'")->count();
  3509. $aihuanlianzhou = M("video_list_test")->where("id>0 and site='AI' and add_time>'$seven_time_chuo'")->count();
  3510. $lingleizhou = M("video_list_test")->where("id>0 and site='孕妇做爱' or site='性感人妖' or site='人兽动物' or site='超级大胆' or site='另类猎奇' or site='同性做爱'")->count();
  3511. $oumei_list= array('name'=>'探花大神','zhou'=>"$tanhuazhou",'all'=>"$tanhua");
  3512. $asian_list= array('name'=>'sm调教','zhou'=>"$smtiaojiaozhou",'all'=>"$smtiaojiao");
  3513. $donman_list= array('name'=>'AI乱伦','zhou'=>"$aihuanlianzhou",'all'=>"$aihuanlian");
  3514. $fancha_list= array('name'=>'另类奇葩','zhou'=>"$lingleizhou",'all'=>"$linglei");
  3515. $data_list = array($oumei_list,$asian_list,$donman_list,$fancha_list);
  3516. break;
  3517. case '4':
  3518. $xuebaimeiru = M("video_list_test")->where("id>0 and site='雪白美乳'")->count();
  3519. $wanou = M("video_list_test")->where("id>0 and site='玩偶姐姐'")->count();
  3520. $avjeishuo = M("video_list_test")->where("id>0 and site='AV解说'")->count();
  3521. $tianmei = M("video_list_test")->where("id>0 and uploader='另类猎奇'")->count();
  3522. $xuebaimeiruzhou = M("video_list_test")->where("id>0 and site='雪白美乳'")->count();
  3523. $wanouzhou = M("video_list_test")->where("id>0 and site='玩偶姐姐'")->count();
  3524. $avjeishuozhou = M("video_list_test")->where("id>0 and site='AV解说'")->count();
  3525. $tianmeizhou = M("video_list_test")->where("id>0 and uploader='粉嫩少女'")->count();
  3526. $oumei_list= array('name'=>'雪白美乳','zhou'=>"$xuebaimeiruzhou",'all'=>"$xuebaimeiru");
  3527. $asian_list= array('name'=>'玩偶姐姐','zhou'=>"$wanouzhou",'all'=>"$wanou");
  3528. $donman_list= array('name'=>'av解说','zhou'=>"$avjeishuozhou",'all'=>"$avjeishuo");
  3529. $fancha_list= array('name'=>'甜美萝莉','zhou'=>"$tianmeizhou",'all'=>"$tianmei");
  3530. $data_list = array($oumei_list,$asian_list,$donman_list,$fancha_list);
  3531. break;
  3532. default:
  3533. echo "type error";
  3534. }
  3535. if ($data_list){
  3536. $data['code'] = '200';
  3537. $data['status'] = '1';
  3538. $data['message'] = 'ok';
  3539. $data['data'] = $data_list;
  3540. echo json_encode($data);
  3541. }else{
  3542. $data['code'] = '200';
  3543. $data['status'] = '2';
  3544. $data['message'] = 'error';
  3545. $data['data'] = "$data_list";
  3546. echo json_encode($data);
  3547. }
  3548. }else{
  3549. echo $this->returnData();
  3550. }
  3551. }
  3552. /**
  3553. * 版本:
  3554. * 新增/更新:
  3555. * 简述:
  3556. * @param $templateid []
  3557. * @return $type 消息类型
  3558. */
  3559. public function show_video_all_count(){
  3560. header('Content-Type:text/json;charset=utf-8');
  3561. header('Access-Control-Allow-Origin:*');
  3562. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3563. header('Access-Control-Allow-Methods:POST');
  3564. header('Access-Control-Expose-Headers:*');
  3565. if (!empty($_POST)){
  3566. $token = $_POST['token'];
  3567. if ($token != 'b8e3bb6ef8747d7') {
  3568. $data['code'] = '203';
  3569. $data['msg'] = 'token错误';
  3570. echo json_encode($data);
  3571. die;
  3572. }
  3573. // $page = $_POST['page'];
  3574. // $size = $_POST['size'];
  3575. // $arr = M("slgj_user_feedback")->page($page, $size)->order("id desc")->select();
  3576. $type_list_all =array(
  3577. array('欧美','亚洲','动漫','素人反差'),
  3578. array('黑料','网爆门','海角乱伦','麻豆传媒'),
  3579. array('探花大神','SM调教','AI换脸','另类猎奇'),
  3580. array('雪白美乳','玩偶姐姐','AV解说','甜美萝莉'),
  3581. );
  3582. $any_site_count = M("video_list_test")->where("id>0")->field("site,count(site) as wuwu")->group('site')->order('wuwu desc')->select();
  3583. $oumei_number = 0;
  3584. $asian_number = 0;
  3585. $anime_number = 0;
  3586. $wb_number = 0;
  3587. $hl_number = 0;
  3588. $fc_number = 0;
  3589. $hj_number = 0;
  3590. $madou_number = 0;
  3591. $tanhua_number=0;
  3592. $ai_number=0;
  3593. $linglei_number=0;
  3594. $meiru_number=0;
  3595. $sm_number=0;
  3596. $wanou_number=0;
  3597. $avjieshuo_number=0;
  3598. $luoli_number=0;
  3599. foreach ($any_site_count as $key => $value) {
  3600. $vtype = $value['site'];
  3601. $vconunt = $value['wuwu'];
  3602. switch ($vtype) {
  3603. case 'Anime':
  3604. $anime_number += $vconunt;
  3605. break;
  3606. case '动画':
  3607. $anime_number += $vconunt;
  3608. break;
  3609. case 'Asian':
  3610. $asian_number += $vconunt;
  3611. break;
  3612. case 'EUA':
  3613. $oumei_number += $vconunt;
  3614. break;
  3615. case 'WB':
  3616. $wb_number += $vconunt;
  3617. break;
  3618. case 'HL':
  3619. $hl_number += $vconunt;
  3620. break;
  3621. case 'FC':
  3622. $fc_number += $vconunt;
  3623. break;
  3624. case 'HJ':
  3625. //海角乱伦
  3626. $hj_number+= $vconunt;
  3627. break;
  3628. case '麻豆传媒':
  3629. //麻豆传媒
  3630. $madou_number+= $vconunt;
  3631. break;
  3632. case '国产探花':
  3633. //探花大神
  3634. $tanhua_number+= $vconunt;
  3635. break;
  3636. case 'AI':
  3637. //明星换脸
  3638. $ai_number+= $vconunt;
  3639. break;
  3640. case '孕妇做爱':
  3641. //另类猎奇 孕妇
  3642. $linglei_number+= $vconunt;
  3643. break;
  3644. case '另类猎奇':
  3645. //另类猎奇 猎奇
  3646. $linglei_number+= $vconunt;
  3647. break;
  3648. case '人兽动物':
  3649. //另类猎奇 人兽
  3650. $linglei_number+= $vconunt;
  3651. break;
  3652. case '性感人妖':
  3653. //另类猎奇 人妖
  3654. $linglei_number+= $vconunt;
  3655. break;
  3656. case '同性做爱':
  3657. //另类猎奇 同性
  3658. $linglei_number+= $vconunt;
  3659. break;
  3660. case '超级大胆':
  3661. //另类猎奇 超级大胆
  3662. $linglei_number+= $vconunt;
  3663. break;
  3664. case '雪白美乳':
  3665. $meiru_number+= $vconunt;
  3666. //雪白美乳
  3667. break;
  3668. case 'SM调教':
  3669. $sm_number+= $vconunt;
  3670. //SM调教
  3671. break;
  3672. case '玩偶姐姐':
  3673. $wanou_number+= $vconunt;
  3674. //玩偶姐姐
  3675. break;
  3676. case 'AV解说':
  3677. $avjieshuo_number+= $vconunt;
  3678. //av解说
  3679. break;
  3680. case '制服学妹':
  3681. $luoli_number+= $vconunt;
  3682. //超级大胆
  3683. break;
  3684. case '马尾学妹':
  3685. $luoli_number+= $vconunt;
  3686. //超级大胆
  3687. break;
  3688. case '后入嫩穴':
  3689. $luoli_number+= $vconunt;
  3690. //超级大胆
  3691. break;
  3692. case '超级巨臀':
  3693. $luoli_number+= $vconunt;
  3694. //超级大胆
  3695. break;
  3696. case '美臀翘臀':
  3697. $luoli_number+= $vconunt;
  3698. //超级大胆
  3699. break;
  3700. default:
  3701. // echo $vtype;
  3702. }
  3703. }
  3704. $all_type_number['oumei_count'] ="$oumei_number";
  3705. $all_type_number['asian_count'] ="$asian_number";
  3706. $all_type_number['anime_count'] ="$anime_number";
  3707. $all_type_number['wb_count'] = "$wb_number";
  3708. $all_type_number['fc_count']= "$fc_number";
  3709. $all_type_number['hl_count']="$hl_number";
  3710. $all_type_number['HJ_number']="$hj_number";
  3711. $all_type_number['madou_number']="$madou_number";
  3712. $all_type_number['tanhua_number']="$tanhua_number";
  3713. $all_type_number['ai_number']="$ai_number";
  3714. $all_type_number['linglei_number']="$linglei_number";
  3715. $all_type_number['meiru_number']="$meiru_number";
  3716. $all_type_number['sm_number']="$sm_number";
  3717. $all_type_number['wanou_number']="$wanou_number";
  3718. $all_type_number['avjieshuo_number']="$avjieshuo_number";
  3719. $all_type_number['luoli_number']="$luoli_number";
  3720. $data['code'] = '200';
  3721. $data['status'] = '1';
  3722. $data['message'] = '';
  3723. $data['data'] = $all_type_number;
  3724. echo json_encode($data);
  3725. }else{
  3726. echo $this->returnData();
  3727. }
  3728. }
  3729. /**
  3730. * 版本:
  3731. * 新增/更新:
  3732. * 简述:add_test_video
  3733. * @param $templateid []
  3734. * @return $type 消息类型
  3735. */
  3736. public function save_beizhu(){
  3737. header('Content-Type:text/json;charset=utf-8');
  3738. header('Access-Control-Allow-Origin:*');
  3739. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3740. header('Access-Control-Allow-Methods:POST');
  3741. header('Access-Control-Expose-Headers:*');
  3742. if (!empty($_POST)){
  3743. $uid = $_POST['uid'];
  3744. $beizhu = $_POST['beizhu'];
  3745. $save_yn = M("user_info")->where("id=$uid")->save($_POST);
  3746. if ($save_yn){
  3747. $data['code'] = '200';
  3748. $data['status'] = '1';
  3749. $data['message'] = 'ok';
  3750. echo json_encode($data);
  3751. }else{
  3752. $data['code'] = '200';
  3753. $data['status'] = '2';
  3754. $data['message'] = 'error';
  3755. echo json_encode($data);
  3756. }
  3757. }else{
  3758. echo $this->returnData();
  3759. }
  3760. }
  3761. public function advertShowList()
  3762. {
  3763. // 指定允许其他域名访问
  3764. header('Access-Control-Allow-Origin:*');
  3765. // 响应类型
  3766. header('Access-Control-Allow-Methods:POST');
  3767. // 响应头设置
  3768. header('Access-Control-Allow-Headers:x-requested-with,content-type');
  3769. if (!empty($_POST)) {
  3770. $token = $_POST['token']; //b8e3bb6ef8747d7
  3771. if ($token != 'b8e3bb6ef8747d7') {
  3772. $data['code'] = '203';
  3773. $data['msg'] = 'token错误';
  3774. echo json_encode($data);
  3775. die;
  3776. }
  3777. $page = $_POST['page'];
  3778. $size = $_POST['size'];
  3779. $arr = M("slgj_advert_list")->page($page, $size)->where("type='视频列表广告'")->select();
  3780. if ($arr) {
  3781. $total = M("slgj_advert_list")->where("type='视频列表广告'")->count();
  3782. $data['code'] = '200';
  3783. $data['msg'] = '请求成功';
  3784. $data['data'] = $arr;
  3785. $data['total'] = $total;
  3786. echo json_encode($data);
  3787. } else {
  3788. $data['code'] = '201';
  3789. $data['msg'] = '暂无数据';
  3790. $data['data'] = array();
  3791. $data['total'] = "0";
  3792. echo json_encode($data);
  3793. }
  3794. } else {
  3795. $data['code'] = '202';
  3796. $data['msg'] = '参数不正确';
  3797. echo json_encode($data);
  3798. die;
  3799. }
  3800. }
  3801. /**
  3802. * 版本:1.7
  3803. * 新增/更新:新增
  3804. * 简述:片源统计统计
  3805. * @param $templateid []
  3806. * @return $type 消息类型
  3807. */
  3808. public function video_add_tongJi(){
  3809. header('Content-Type:text/json;charset=utf-8');
  3810. header('Access-Control-Allow-Origin:*');
  3811. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3812. header('Access-Control-Allow-Methods:POST');
  3813. header('Access-Control-Expose-Headers:*');
  3814. if (!empty($_POST)){
  3815. $token = $_POST['token'];
  3816. if ($token != 'b8e3bb6ef8747d7') {
  3817. $data['code'] = '203';
  3818. $data['msg'] = 'token错误';
  3819. echo json_encode($data);
  3820. die;
  3821. }
  3822. $page = $_POST['page'];
  3823. $type=$_POST['type'];
  3824. $page_one = ($page - 1) * 50;
  3825. switch ($type) {
  3826. case 'all':
  3827. $video_seven_add = M("video_list_test")->where("id>0 and uploader in ('AV解说','SM调教','女子SPA','嫖娼站街女','日本无码','港台经典三级','SWAG','亚洲','动漫','厕所偷拍','另类猎奇','国产探花','大尺度综艺','户外车震','男同性恋','抄底偷拍','探花大神','明星换脸','欧美','海角乱伦','玩偶姐姐','福利姬','粉嫩少女','素人反差','网曝门','雪白美乳','顶臀街射','麻豆传媒','黑料吃瓜','性爱知识','吃瓜','有声小说','漫画')")->field("uploader,count('uploader') as count_video")->group('uploader')->order('count_video DESC')->select();
  3828. break;
  3829. case 'vip':
  3830. $video_seven_add = M("video_list_test")->where("id>0 and uploader in ('黑料吃瓜','海角乱伦','明星换脸','麻豆传媒','探花大神','玩偶姐姐','SM调教','甜美萝莉','雪白美乳','福利姬','大尺度综艺','SWAG','户外车震','男同性恋')")->field("uploader,count('uploader') as count_video")->group('uploader')->order('count_video DESC')->select();
  3831. break;
  3832. case 'coins':
  3833. $video_seven_add = M("video_list_test")->where("id>0 and uploader in ('网曝门','AV解说','另类猎奇','女子SPA','嫖娼站街女','日本无码','港台经典三级','粉嫩少女','素人反差','顶臀街射','抄底偷拍','厕所偷拍','性爱知识','有声小说','漫画')")->field("uploader,count('uploader') as count_video")->group('uploader')->order('count_video DESC')->select();
  3834. break;
  3835. case 'free':
  3836. $video_seven_add = M("video_list_test")->where("id>0 and uploader in ('亚洲','欧美','动漫','吃瓜')")->field("uploader,count('uploader') as count_video")->group('uploader')->order('count_video DESC')->select();
  3837. break;
  3838. default:
  3839. echo "type error";
  3840. }
  3841. $seven_time_chuo = time() - (7 * 24 * 3600);
  3842. foreach ($video_seven_add as $key => $value) {
  3843. $video_uplodaer=$value['uploader'];
  3844. if($value['uploader']=="性爱知识"){
  3845. $video_seven_add[$key]['uploader']='性爱老师';
  3846. }elseif($value['uploader']=="吃瓜"){
  3847. $video_seven_add[$key]['uploader']='吃瓜';
  3848. }else{
  3849. $video_seven_add[$key]['uploader']=$value['uploader'];
  3850. }
  3851. # code...
  3852. $video_seven_add[$key]['seven']= M("video_list_test")->where("add_time>'$seven_time_chuo' and uploader='$video_uplodaer'")->count();;
  3853. }
  3854. if ($type=='coins' or $type=='all' ){
  3855. $xiaoshuo['uploader'] ='色情小说';
  3856. $xiaoshuo['count_video'] =M("novel_list")->where("id>0")->count();
  3857. $xiaoshuo['seven'] =M("novel_list")->where("add_time>'$seven_time_chuo'")->count();
  3858. array_push($video_seven_add,$xiaoshuo);
  3859. $sanp['uploader'] ='3P';
  3860. $sanp['count_video'] =M("video_list_test")->where("uploader='Pornhub' and site='3P'")->count();
  3861. $sanp['seven'] =M("video_list_test")->where("uploader='Pornhub' and site='3P' and add_time>'$seven_time_chuo'")->count();
  3862. array_push($video_seven_add,$sanp);
  3863. $shiba['uploader'] ='18岁';
  3864. $shiba['count_video'] =M("video_list_test")->where("uploader='Pornhub' and site='18岁'")->count();
  3865. $shiba['seven'] =M("video_list_test")->where("uploader='Pornhub' and site='18岁' and add_time>'$seven_time_chuo'")->count();
  3866. array_push($video_seven_add,$shiba);
  3867. $kj['uploader'] ='口交';
  3868. $kj['count_video'] =M("video_list_test")->where("uploader='Pornhub' and site='KJ'")->count();
  3869. $kj['seven'] =M("video_list_test")->where("uploader='Pornhub' and site='KJ' and add_time>'$seven_time_chuo'")->count();
  3870. array_push($video_seven_add,$kj);
  3871. $jipinsetu['uploader'] ='极品色图';
  3872. $jipinsetu['count_video'] =M("video_list_test")->where("site in ('超模','超爽')")->count();
  3873. $jipinsetu['seven'] =M("video_list_test")->where("site in ('超模','超爽') and add_time>'$seven_time_chuo'")->count();
  3874. array_push($video_seven_add,$jipinsetu);
  3875. $fenglou['uploader'] ='凤楼约炮';
  3876. $fenglou['count_video'] =M("69ttb")->count();
  3877. $fenglou['seven'] =M("69ttb")->where("timess>'$seven_time_chuo'")->count();
  3878. array_push($video_seven_add,$fenglou);
  3879. }
  3880. $data['code'] = '200';
  3881. $data['status'] = '1';
  3882. $data['message'] = 'ok';
  3883. $data['data'] = $video_seven_add;
  3884. echo json_encode($data);
  3885. }else{
  3886. echo $this->returnData();
  3887. }
  3888. }
  3889. /**
  3890. * 版本:2.00
  3891. * 新增/更新:
  3892. * 简述:
  3893. * @param $templateid []
  3894. * @return $type 消息类型
  3895. */
  3896. public function now_online_person(){
  3897. header('Content-Type:text/json;charset=utf-8');
  3898. header('Access-Control-Allow-Origin:*');
  3899. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3900. header('Access-Control-Allow-Methods:POST');
  3901. header('Access-Control-Expose-Headers:*');
  3902. if (!empty($_POST)){
  3903. $token = $_POST['token'];
  3904. if ($token != 'b8e3bb6ef8747d7') {
  3905. $data['code'] = '203';
  3906. $data['msg'] = 'token错误';
  3907. echo json_encode($data);
  3908. die;
  3909. }
  3910. $noe_time = time();
  3911. $ten_min = $noe_time - (60*10);
  3912. $one_ten_min = $noe_time - (60*60);
  3913. $two_ten_min = $noe_time - (2*60*60);
  3914. $video_seven_add['online']= M("user_info")->where("last_login_time>'$ten_min'")->count();;
  3915. $video_seven_add['last_one_online']= M("user_info")->where("last_login_time BETWEEN $two_ten_min and $one_ten_min")->count();;
  3916. $data['code'] = '200';
  3917. $data['status'] = '1';
  3918. $data['message'] = 'ok';
  3919. $data['data'] = $video_seven_add;
  3920. echo json_encode($data);
  3921. }else{
  3922. echo $this->returnData();
  3923. }
  3924. }
  3925. /**
  3926. * 新增活跃
  3927. * 一
  3928. * @param $templateid []
  3929. * @return $type 消息类型
  3930. * 全部活跃
  3931. */
  3932. public function all_huoyue_renshu(){
  3933. header('Content-Type:text/json;charset=utf-8');
  3934. header('Access-Control-Allow-Origin:*');
  3935. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  3936. header('Access-Control-Allow-Methods:POST');
  3937. header('Access-Control-Expose-Headers:*');
  3938. if (!empty($_POST)){
  3939. $token = $_POST['token']; //b8e3bb6ef8747d7
  3940. if ($token != 'b8e3bb6ef8747d7') {
  3941. $data['code'] = '203';
  3942. $data['msg'] = 'token错误';
  3943. echo json_encode($data);
  3944. die;
  3945. }
  3946. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  3947. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  3948. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  3949. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  3950. $todayTimestamp = time(); // 获取当前时间戳
  3951. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  3952. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  3953. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  3954. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  3955. $zhou_end_time = time();
  3956. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  3957. $yue_end_time = time();
  3958. $user_info_list = M('user_info');
  3959. $user_novip = $user_info_list->where("vip_yn=0 ")->field('id')->select();
  3960. $arr['jinri_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $jinri_start_time and $jinri_end_time ")->count();
  3961. $arr['zuori_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $zuo_start_time and $zuo_end_time ")->count();
  3962. $arr['sanri_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $san_start_time and $san_end_time")->count();
  3963. // echo PHP_EOL.$user_info_list->_sql();
  3964. $arr['zhou_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $zhou_start_time and $zhou_end_time ")->count();
  3965. $arr['yue_xinzeng_num'] = $user_info_list->where("add_time BETWEEN $yue_start_time and $yue_end_time")->count();
  3966. $arr['jilei_xinzeng_num'] = $user_info_list->where("id>0 ")->count();
  3967. $huoyue = M("huoyue_list");
  3968. $huoyue_jin = M("huoyue_list")->where("time BETWEEN $jinri_start_time and $jinri_end_time ")->field("uid")->group("uid")->select();
  3969. $huoyue_zuo = M("huoyue_list")->where(" time BETWEEN $zuo_start_time and $zuo_end_time ")->field("uid")->group("uid")->select();
  3970. $huoyue_san = M("huoyue_list")->where("time BETWEEN $san_start_time and $san_end_time ")->field("uid")->group("uid")->select();;
  3971. // echo PHP_EOL.M("huoyue_list")->_sql();
  3972. $huoyue_zhou = M("huoyue_list")->where(" time BETWEEN $zhou_start_time and $zhou_end_time ")->field("uid")->group("uid")->select();
  3973. $huoyue_yue = M("huoyue_list")->where(" time BETWEEN $yue_start_time and $yue_end_time")->field("uid")->group("uid")->select();
  3974. $huoyue_jilei = $user_info_list->where("last_login_time is not null ")->field("id")->select();
  3975. $arrs['jinri_huoyue_num'] =count($huoyue_jin);
  3976. $arrs['zuori_huoyue_num'] =count($huoyue_zuo);
  3977. $arrs['sanri_huoyue_num'] = count($huoyue_san);
  3978. $arrs['zhou_huoyue_num'] =count($huoyue_zhou);
  3979. $arrs['yue_huoyue_num'] =count($huoyue_yue);
  3980. $arrs['jilei_huoyue_num'] =count($huoyue_jilei);
  3981. $arr_list = array($arr,$arrs);
  3982. $data['code'] = '200';
  3983. $data['status'] = '1';
  3984. $data['message'] = '';
  3985. $data['data'] =$arr_list;
  3986. echo json_encode($data);
  3987. }else{
  3988. echo $this->returnData();
  3989. }
  3990. }
  3991. /**
  3992. * 版本:
  3993. * 新增/更新:
  3994. * 简述:
  3995. * @param $templateid []
  3996. * @return $type 消息类型
  3997. * 免费活跃
  3998. */
  3999. public function free_huoyue_renshu(){
  4000. header('Content-Type:text/json;charset=utf-8');
  4001. header('Access-Control-Allow-Origin:*');
  4002. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  4003. header('Access-Control-Allow-Methods:POST');
  4004. header('Access-Control-Expose-Headers:*');
  4005. if (!empty($_POST)){
  4006. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  4007. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  4008. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  4009. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  4010. $todayTimestamp = time(); // 获取当前时间戳
  4011. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  4012. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  4013. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  4014. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  4015. $zhou_end_time = time();
  4016. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  4017. $yue_end_time = time();
  4018. $vip_user= M("user_info")->where("vip_money is null")->field("id")->select();
  4019. $last_id = array_column($vip_user, 'id');
  4020. $str = json_encode($last_id);
  4021. $str = substr($str, 1, -1);
  4022. $huoyue = M("huoyue_list");
  4023. $huoyue_jin = M("huoyue_list")->where("uid in($str) and time BETWEEN $jinri_start_time and $jinri_end_time ")->field("uid")->group("uid")->select();
  4024. $huoyue_zuo = M("huoyue_list")->where("uid in($str) and time BETWEEN $zuo_start_time and $zuo_end_time ")->field("uid")->group("uid")->select();
  4025. $huoyue_san = M("huoyue_list")->where("uid in($str) and time BETWEEN $san_start_time and $san_end_time ")->field("uid")->group("uid")->select();;
  4026. // echo PHP_EOL.M("huoyue_list")->_sql();
  4027. $huoyue_zhou = M("huoyue_list")->where(" uid in($str) and time BETWEEN $zhou_start_time and $zhou_end_time ")->field("uid")->group("uid")->select();
  4028. $huoyue_yue = M("huoyue_list")->where(" uid in($str) and time BETWEEN $yue_start_time and $yue_end_time")->field("uid")->group("uid")->select();
  4029. $huoyue_jilei = M("user_info")->where("last_login_time is not null and vip_money is null ")->field("id")->select();
  4030. $arrs['jinri_huoyue_num'] =count($huoyue_jin);
  4031. $arrs['zuori_huoyue_num'] =count($huoyue_zuo);
  4032. $arrs['sanri_huoyue_num'] = count($huoyue_san);
  4033. $arrs['zhou_huoyue_num'] =count($huoyue_zhou);
  4034. $arrs['yue_huoyue_num'] =count($huoyue_yue);
  4035. $arrs['jilei_huoyue_num'] =count($huoyue_jilei);
  4036. $data['code'] = '200';
  4037. $data['status'] = '1';
  4038. $data['message'] = '';
  4039. $data['data'] =$arrs;
  4040. echo json_encode($data);
  4041. }else{
  4042. echo $this->returnData();
  4043. }
  4044. }
  4045. /**
  4046. * 版本:
  4047. * 新增/更新:
  4048. * 简述:fu4fei4huo2yue4
  4049. * @param $templateid []
  4050. * @return $type 消息类型
  4051. * 付费活跃
  4052. */
  4053. public function vip_huoyue_renshu(){
  4054. header('Content-Type:text/json;charset=utf-8');
  4055. header('Access-Control-Allow-Origin:*');
  4056. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  4057. header('Access-Control-Allow-Methods:POST');
  4058. header('Access-Control-Expose-Headers:*');
  4059. if (!empty($_POST)){
  4060. $jinri_start_time = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
  4061. $jinri_end_time = mktime(0, 0, 0, date('m'), date('d') + 1, date('Y')) - 1;
  4062. $zuo_start_time = mktime(0, 0, 0, date('m'), date('d') - 1, date('Y'));
  4063. $zuo_end_time = mktime(0, 0, 0, date('m'), date('d'), date('Y')) - 1;
  4064. $todayTimestamp = time(); // 获取当前时间戳
  4065. $threeDaysAgoTimestamp = strtotime('-3 days', $todayTimestamp); // 获取三天前的时间戳
  4066. $san_start_time = strtotime('midnight', strtotime('-3 days', $todayTimestamp)); // 获取三天前的0点时间戳
  4067. $san_end_time = strtotime('23:59:59', strtotime('-1 day', $todayTimestamp)); // 获取前天的23:59:59时间戳
  4068. $zhou_start_time = strtotime(date("Y-m-d", strtotime("-1 week")) . "00:00:00");
  4069. $zhou_end_time = time();
  4070. $yue_start_time = strtotime(date("Y-m-d", strtotime("-1 month")) . "00:00:00");
  4071. $yue_end_time = time();
  4072. $vip_user= M("user_info")->where("vip_money=1")->field("id")->select();
  4073. $last_id = array_column($vip_user, 'id');
  4074. $str = json_encode($last_id);
  4075. $str = substr($str, 1, -1);
  4076. $huoyue = M("huoyue_list");
  4077. $huoyue_jin = M("huoyue_list")->where("uid in($str) and time BETWEEN $jinri_start_time and $jinri_end_time ")->field("uid")->group("uid")->select();
  4078. $huoyue_zuo = M("huoyue_list")->where(" uid in($str) and time BETWEEN $zuo_start_time and $zuo_end_time ")->field("uid")->group("uid")->select();
  4079. $huoyue_san = M("huoyue_list")->where("uid in($str) and time BETWEEN $san_start_time and $san_end_time ")->field("uid")->group("uid")->select();;
  4080. // echo PHP_EOL.M("huoyue_list")->_sql();
  4081. $huoyue_zhou = M("huoyue_list")->where("uid in($str) and time BETWEEN $zhou_start_time and $zhou_end_time ")->field("uid")->group("uid")->select();
  4082. $huoyue_yue = M("huoyue_list")->where(" uid in($str) and time BETWEEN $yue_start_time and $yue_end_time")->field("uid")->group("uid")->select();
  4083. $huoyue_jilei = M("user_info")->where("last_login_time is not null and vip_money=1")->field("id")->select();
  4084. $arrs['jinri_huoyue_num'] =count($huoyue_jin);
  4085. $arrs['zuori_huoyue_num'] =count($huoyue_zuo);
  4086. $arrs['sanri_huoyue_num'] = count($huoyue_san);
  4087. $arrs['zhou_huoyue_num'] =count($huoyue_zhou);
  4088. $arrs['yue_huoyue_num'] =count($huoyue_yue);
  4089. $arrs['jilei_huoyue_num'] =count($huoyue_jilei);
  4090. $data['code'] = '200';
  4091. $data['status'] = '1';
  4092. $data['message'] = '';
  4093. $data['data'] =$arrs;
  4094. echo json_encode($data);
  4095. }else{
  4096. echo $this->returnData();
  4097. }
  4098. }
  4099. /**
  4100. * 版本:
  4101. * 新增/更新:
  4102. * 简述:
  4103. * @param $templateid []
  4104. * @return $type 消息类型
  4105. */
  4106. public function home_url_list(){
  4107. header('Content-Type:text/json;charset=utf-8');
  4108. header('Access-Control-Allow-Origin:*');
  4109. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  4110. header('Access-Control-Allow-Methods:POST');
  4111. header('Access-Control-Expose-Headers:*');
  4112. if (!empty($_POST)){
  4113. $token = $_POST['token']; //b8e3bb6ef8747d7
  4114. if ($token != 'b8e3bb6ef8747d7') {
  4115. $data['code'] = '203';
  4116. $data['msg'] = 'token错误';
  4117. echo json_encode($data);
  4118. die;
  4119. }
  4120. $img_list = M("shouye_url")->where("type='yj'")->order('id asc')->select();
  4121. if ($img_list){
  4122. $data['code'] = '200';
  4123. $data['status'] = '1';
  4124. $data['message'] = 'ok';
  4125. $data['data'] =$img_list;
  4126. echo json_encode($data);
  4127. }else{
  4128. $data['code'] = '200';
  4129. $data['status'] = '2';
  4130. $data['message'] = 'null';
  4131. $data['data'] = $img_list;
  4132. echo json_encode($data);
  4133. }
  4134. }else{
  4135. echo $this->returnData();
  4136. }
  4137. }
  4138. /**
  4139. * 版本:1.8
  4140. * 新增/更新:add
  4141. * 简述:上传街拍
  4142. * @param $templateid []
  4143. * @return $type 消息类型
  4144. */
  4145. public function upload_video_new()
  4146. {
  4147. ini_set('upload_max_filesize', '4048M');
  4148. ini_set('post_max_size', '4048M');
  4149. header('Content-Type:text/json;charset=utf-8');
  4150. header('Access-Control-Allow-Origin:*');
  4151. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  4152. header('Access-Control-Allow-Methods:POST');
  4153. header('Access-Control-Expose-Headers:*');
  4154. if (!empty($_POST)) {
  4155. $img = $_FILES['mp4'];
  4156. $uploader = $_POST['uploader'];
  4157. $title = $_POST['title'];
  4158. switch ($uploader) {
  4159. case '1':
  4160. $uploader_name = '顶臀街射';
  4161. $videoPath = '/home2/videos/one/DTJS/MP4/'; // 视频集合的上传目录
  4162. $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/DTJS/MP4/';
  4163. if (!file_exists($videoPath)) {
  4164. mkdir($videoPath, 0777, true);
  4165. }
  4166. break;
  4167. case '2':
  4168. $uploader_name = '抄底偷拍';
  4169. $videoPath = '/home2/videos/one/CDTP/MP4/'; // 视频集合的上传目录
  4170. $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/CDTP/MP4/';
  4171. if (!file_exists($videoPath)) {
  4172. mkdir($videoPath, 0777, true);
  4173. }
  4174. break;
  4175. case '3':
  4176. $uploader_name = '厕所偷拍';
  4177. $videoPath = '/home2/videos/one/CSTP/MP4/'; // 视频集合的上传目录
  4178. $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/CSTP/MP4/';
  4179. if (!file_exists($videoPath)) {
  4180. mkdir($videoPath, 0777, true);
  4181. }
  4182. case '4':
  4183. $uploader_name = '厕所偷拍';
  4184. $videoPath = '/home2/videos/one/CSTP/MP4/'; // 视频集合的上传目录
  4185. $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/CSTP/MP4/';
  4186. if (!file_exists($videoPath)) {
  4187. mkdir($videoPath, 0777, true);
  4188. }
  4189. case '5':
  4190. $uploader_name = '厕所偷拍';
  4191. $videoPath = '/home2/videos/one/CSTP/MP4/'; // 视频集合的上传目录
  4192. $url_path = 'https://www.5uafocvs4xlibumya2.xyz/videos/one/CSTP/MP4/';
  4193. if (!file_exists($videoPath)) {
  4194. mkdir($videoPath, 0777, true);
  4195. }
  4196. break;
  4197. default:
  4198. echo "type error";
  4199. }
  4200. $token = $_POST['token']; //b8e3bb6ef8747d7
  4201. if ($token != 'b8e3bb6ef8747d7') {
  4202. $data['code'] = '203';
  4203. $data['msg'] = 'token错误';
  4204. echo json_encode($data);
  4205. die;
  4206. }
  4207. // 上传视频集合
  4208. $configVideo = array(
  4209. 'maxSize' => 0, // 设置视频上传大小(100MB)
  4210. 'exts' => array('mp4', 'avi', 'mkv', 'mov','MOV','MP4'), // 设置视频上传类型
  4211. 'rootPath' => "$videoPath", // 设置附件上传根目录
  4212. );
  4213. $uploadVideo = new \Think\Upload($configVideo); // 实例化视频上传类
  4214. // 上传视频集合
  4215. $infoVideo = $uploadVideo->upload();
  4216. $title_list = explode(',',$title);
  4217. $videoPaths = ''; // 存储上传的视频文件路径
  4218. foreach ($infoVideo as $key => $value) {
  4219. $savepath = $value['savepath'];
  4220. $savename = $value['savename'];
  4221. $videoPaths = $videoPath .$savepath . $savename ;
  4222. $url_videoPaths = $url_path .$savepath . $savename ;
  4223. $fancha_list[$key]['uploader'] = $uploader_name;
  4224. $fancha_list[$key]['title'] = $title_list[$key];
  4225. $fancha_list[$key]['mp4_path'] = $videoPaths;
  4226. $fancha_list[$key]['url_path'] = $url_videoPaths;
  4227. $fancha_list[$key]['type'] = '0';
  4228. M("upload_videos_list")->add($fancha_list[$key]);
  4229. }
  4230. // 返回上传成功的文件路径
  4231. $this->ajaxReturn(array(
  4232. 'status' => 1,
  4233. 'message' => '上传成功',
  4234. 'data' => $fancha_list,
  4235. ));
  4236. } else {
  4237. echo $this->returnData();
  4238. }
  4239. }
  4240. //你好111,你好2222,你好333,你好444,你好555
  4241. //413 Request Entity Too Large
  4242. /**
  4243. * 版本:
  4244. * 新增/更新:
  4245. * 简述:
  4246. * @param $templateid []
  4247. * @return $type 消息类型
  4248. */
  4249. public function take_photo_on_street_list(){
  4250. header('Content-Type:text/json;charset=utf-8');
  4251. header('Access-Control-Allow-Origin:*');
  4252. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  4253. header('Access-Control-Allow-Methods:POST');
  4254. header('Access-Control-Expose-Headers:*');
  4255. if (!empty($_POST)){
  4256. $page = $_POST['page'];
  4257. $type=$_POST['type'];
  4258. $page_one = ($page - 1) * 50;
  4259. switch ($type) {
  4260. case '1':
  4261. $paid_agent_list = M("upload_videos_list")->where("uploader='顶臀街射' and type!='4'")->order('id desc')->LIMIT($page_one, 50)->select();
  4262. $all_num = M("upload_videos_list")->where("uploader='顶臀街射'")->count();
  4263. break;
  4264. case '2':
  4265. $paid_agent_list = M("upload_videos_list")->where("uploader='抄底偷拍' and type!='4'")->order('id desc')->LIMIT($page_one, 50)->select();
  4266. $all_num =M("upload_videos_list")->where("uploader='抄底偷拍'")->count();
  4267. break;
  4268. case '3':
  4269. $paid_agent_list = M("upload_videos_list")->where("uploader='厕所偷拍' and type!='4'")->order('id desc')->LIMIT($page_one, 50)->select();
  4270. $all_num =M("upload_videos_list")->where("uploader='厕所偷拍'")->count();
  4271. break;
  4272. default:
  4273. echo "type error";
  4274. }
  4275. if ($paid_agent_list){
  4276. $data['code'] = '200';
  4277. $data['status'] = '1';
  4278. $data['message'] = 'ok';
  4279. $data['all_num'] = $all_num;
  4280. $data['data'] = $paid_agent_list;
  4281. echo json_encode($data);
  4282. }else{
  4283. $data['code'] = '200';
  4284. $data['status'] = '2';
  4285. $data['message'] = 'null';
  4286. $data['all_num'] = 0;
  4287. $data['data'] = $paid_agent_list;
  4288. echo json_encode($data);
  4289. }
  4290. }else{
  4291. echo $this->returnData();
  4292. }
  4293. }
  4294. /**
  4295. * 版本:
  4296. * 新增/更新:
  4297. * 简述:
  4298. * @param $templateid []
  4299. * @return $type 消息类型
  4300. */
  4301. public function delete_take_photo(){
  4302. header('Content-Type:text/json;charset=utf-8');
  4303. header('Access-Control-Allow-Origin:*');
  4304. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  4305. header('Access-Control-Allow-Methods:POST');
  4306. header('Access-Control-Expose-Headers:*');
  4307. if (!empty($_POST)){
  4308. $id = $_POST['id'];
  4309. $mp4_path = M("upload_videos_list")->where("id=$id")->getField("mp4_path");
  4310. $video_id = M("upload_videos_list")->where("id=$id")->getField("video_list_id");
  4311. $type_four['type'] = 4;
  4312. $yn_delete = M("upload_videos_list")->where("id=$id")->save($type_four);
  4313. $file = "$mp4_path";
  4314. M("video_twelve_suiji_test")->where("v_id=$video_id")->delete();
  4315. M("video_twelve_suiji")->where("v_id=$video_id")->delete();
  4316. M("video_list_test")->where("id=$video_id")->delete();
  4317. if (unlink($file) and $yn_delete)
  4318. {
  4319. $data['message'] = 'ok';
  4320. echo json_encode($data);
  4321. }
  4322. else
  4323. {
  4324. $data['message'] = 'error';
  4325. echo json_encode($data);
  4326. }
  4327. }else{
  4328. echo $this->returnData();
  4329. }
  4330. }
  4331. /**
  4332. * 版本:1.75
  4333. * 新增/更新:add
  4334. * 简述:save_home_url
  4335. * @param $templateid []
  4336. * @return $type 消息类型
  4337. */
  4338. public function update_home_url(){
  4339. header('Content-Type:text/json;charset=utf-8');
  4340. header('Access-Control-Allow-Origin:*');
  4341. header("Access-Control-Allow-Headers:token,Origin, X-Requested-With, Content-Type, Accept");
  4342. header('Access-Control-Allow-Methods:POST');
  4343. header('Access-Control-Expose-Headers:*');
  4344. if (!empty($_POST)){
  4345. $usr_c = $_POST['url'];
  4346. $id = $_POST['id'];
  4347. $save = M("shouye_url")->where("id=$id")->save($_POST);
  4348. if($save){
  4349. $data['code'] = '200';
  4350. $data['status'] = '1';
  4351. $data['message'] = 'ok';
  4352. echo json_encode($data);
  4353. }else{
  4354. $data['code'] = '200';
  4355. $data['status'] = '2';
  4356. $data['message'] = 'error';
  4357. echo json_encode($data);
  4358. }
  4359. }else{
  4360. echo $this->returnData();
  4361. }
  4362. }
  4363. }