Index.php 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674
  1. <?php
  2. namespace app\api\controller;
  3. use app\common\controller\Api;
  4. use Think\Cache;
  5. use think\Db;
  6. use wxpay;
  7. use Qcloud\Cos\Client;
  8. use Qcloud\Cos\Exception\ServiceResponseException;
  9. /**
  10. * 首页接口
  11. */
  12. class Index extends Api
  13. {
  14. protected $noNeedLogin = ['banner', 'activelist', 'personaltype', 'personalactivetype', 'car', 'leader', 'personaldirection', 'activeinfo', 'position', 'gamelist', 'special_models', 'app_error','indexdata','tudingc'];
  15. protected $noNeedRight = ['*'];
  16. public function __construct(){
  17. $this->error('老接口全部停用');
  18. }
  19. /**
  20. * 首页
  21. *
  22. */
  23. public function index()
  24. {
  25. $this->success('请求成功');
  26. }
  27. //轮播图
  28. public function banner()
  29. {
  30. $list = Db::name('banner')->field('id, title, image, url')->where(['status' => 0])->order('weigh', 'desc')->select();
  31. $list = list_domain_image($list, ['image']);
  32. $this->success('轮播图', $list);
  33. }
  34. //活动列表
  35. public function activelist() {
  36. $type = input('type', 0, 'intval'); //分类:1=休闲,2=中度
  37. $keyword = input('keyword', '', 'trim'); //关键字
  38. // $where['signupendtime'] = ['gt', time()];
  39. $where['status'] = ['neq', 3];
  40. $where['showstatus'] = 1;
  41. if ($type) {
  42. $where['type'] = $type;
  43. }
  44. if ($keyword !== '') {
  45. $where['title|desc|remark|collectionplace|leader'] = ['like', '%'.$keyword.'%'];
  46. }
  47. $list = Db::name('active')->field('id, type, title, desc, remark, image, price, maxperson, currentperson, status')
  48. ->where($where)->page($this->page, $this->pagenum)->order('weigh, createtime desc')->select();
  49. $list = list_domain_image($list, ['image']);
  50. foreach ($list as &$v) {
  51. if ($v['maxperson'] <= $v['currentperson']) {
  52. $v['is_full'] = 1;
  53. } else {
  54. $v['is_full'] = 0;
  55. }
  56. $v['surplusperson'] = $v['maxperson'] - $v['currentperson'];
  57. }
  58. $this->success('活动列表', $list);
  59. }
  60. //活动详情
  61. public function activeinfo() {
  62. $id = input('id', 0, 'intval');
  63. if (!$id) {
  64. $this->error('参数缺失');
  65. }
  66. $info = Db::name('active')->find($id);
  67. if (!$info) {
  68. $this->error('数据不存在');
  69. }
  70. $info = info_domain_image($info, ['image']);
  71. $info['starttime'] = date('Y-m-d H:i', $info['starttime']);
  72. $info['endtime'] = date('Y-m-d H:i', $info['endtime']);
  73. $info['collectiontime'] = date('Y-m-d H:i', $info['collectiontime']);
  74. $info['signupendtime'] = date('Y-m-d H:i', $info['signupendtime']);
  75. $info['refundendtime'] = date('Y-m-d H:i', $info['refundendtime']);
  76. //查询已报名列表
  77. $active_people = Db::name('active_people')->where(['active_id' => $id, 'status' => ['neq', 3]])->field('user_id, name, createtime')->select();
  78. $user = Db::name('user');
  79. foreach ($active_people as &$v) {
  80. $user_info = $user->field('nickname, avatar')->where(['id' => $v['user_id']])->find();
  81. $v['name'] = $user_info['nickname'];
  82. $v['avatar'] = $user_info['avatar'];
  83. $v['createtime'] = date('Y-m-d H:i:s', $v['createtime']);
  84. }
  85. $info['active_people'] = $active_people;
  86. $info['customer_service'] = config('site.customer_service') ? config('site.customer_service') : ''; //客服电话
  87. $this->success('活动详情', $info);
  88. }
  89. //报名活动之前检查
  90. public function beforesignup() {
  91. $id = input('id', 0, 'intval'); //活动id
  92. if (!$id) {
  93. $this->error('请选择要报名的活动');
  94. }
  95. $info = Db::name('active')->find($id);
  96. if (!$info) {
  97. $this->error('活动不存在');
  98. }
  99. if ($info['status'] == 2) {
  100. $this->error('活动已经结束');
  101. }
  102. if ($info['status'] == 3) {
  103. $this->error('活动已经取消');
  104. }
  105. if ($info['showstatus'] != 1) {
  106. $this->error('活动暂时不能报名');
  107. }
  108. if ($info['signupendtime'] < time()) {
  109. $this->error('活动报名已经截止');
  110. }
  111. if ($info['currentperson'] >= $info['maxperson']) {
  112. $this->error('活动名额已满');
  113. }
  114. //检查自己信息是否完善
  115. if (!$this->auth->realname) {
  116. $this->success('请在个人资料中完善真实姓名', ['code' => 3]);
  117. }
  118. if (!$this->auth->idcard) {
  119. $this->success('请在个人资料中完善身份证号', ['code' => 3]);
  120. }
  121. if (!$this->auth->emergencycontact) {
  122. $this->success('请在个人资料中完善紧急联系人', ['code' => 3]);
  123. }
  124. if (!$this->auth->contactmobile) {
  125. $this->success('请在个人资料中完善紧急联系方式', ['code' => 3]);
  126. }
  127. $this->success('检查通过');
  128. }
  129. //查询可用优惠券
  130. public function canusercoupon() {
  131. $price = input('price', '', 'trim'); //价格
  132. if (!preg_match('/^[0-9]+(.[0-9]{1,2})?$/', $price) || $price < 0) {
  133. $this->error('价格错误');
  134. }
  135. $where['user_id'] = $this->auth->id;
  136. $where['endtime'] = ['egt', time()];
  137. $where['status'] = 0;
  138. $map = 'type = 1 or (type = 2 and minmoney <= '.$price.')';
  139. $list = Db::name('user_coupon')->field('id, title, desc, type, money, minmoney')->where($where)->where($map)->select();
  140. // p(\db()->getLastSql());
  141. $this->success('查询可用优惠券', $list);
  142. }
  143. //报名活动
  144. public function signupactive() {
  145. //检查自己信息是否完善
  146. if (!$this->auth->realname || !$this->auth->idcard || !$this->auth->emergencycontact || !$this->auth->contactmobile) {
  147. $this->success('请在个人资料中完善资料', ['code' => 3]);
  148. }
  149. $id = input('id', 0, 'intval'); //活动id
  150. // $collectionplace = input('collectionplace', '', 'trim'); //集合地点
  151. //人员信息json串:
  152. // name姓名 credtype证件类型 idcard身份证号 mobile手机号 emergencycontact紧急联系人 contactmobile紧急联系方式
  153. // insurance保险 originalprice原价 vipprice会员价 coupon_id用户优惠券ID is_free是否使用免费次数:0=否,1=是
  154. // price小计 is_self是否本人:0=否,1=是 collectionplace集合地点
  155. $active_people = input('active_people', '', 'trim');
  156. $paytype = input('paytype', 0, 'intval'); //支付方式:0=余额,1=微信
  157. $total_price = input('total_price', 0, 'trim'); //总价格
  158. // if ($collectionplace === '' || iconv_strlen($collectionplace, 'utf-8') > 255) {
  159. // $this->error('请选择集合地点');
  160. // }
  161. if (!preg_match('/^[0-9]+(.[0-9]{1,2})?$/', $total_price) || $total_price < 0) {
  162. $this->error('合计价格错误');
  163. }
  164. if (!in_array($paytype, [0, 1])) {
  165. $this->error('支付错误');
  166. }
  167. if ($total_price == 0 && $paytype != 0) {
  168. $this->error('请选择余额支付');
  169. }
  170. //检查活动信息
  171. if (!$id) {
  172. $this->error('请选择要报名的活动');
  173. }
  174. $info = Db::name('active')->find($id);
  175. if (!$info) {
  176. $this->error('活动不存在');
  177. }
  178. if ($info['status'] == 2) {
  179. $this->error('活动已经结束');
  180. }
  181. if ($info['status'] == 3) {
  182. $this->error('活动已经取消');
  183. }
  184. if ($info['showstatus'] != 1) {
  185. $this->error('活动暂时不能报名');
  186. }
  187. if ($info['signupendtime'] < time()) {
  188. $this->error('活动报名已经截止');
  189. }
  190. if ($info['currentperson'] >= $info['maxperson']) {
  191. $this->error('活动名额已满');
  192. }
  193. //检查人员信息
  194. if (!$active_people) {
  195. $this->error('请添加报名人员信息');
  196. }
  197. $active_people_arr = json_decode($active_people, true);
  198. if (!$active_people_arr) {
  199. $this->error('请添加报名人员信息');
  200. }
  201. if ($info['currentperson'] + count($active_people_arr) > $info['maxperson']) {
  202. $this->error('活动名额不足');
  203. }
  204. //会员信息
  205. $vip_info = Db::name('vip')->find($this->auth->maxlevel);
  206. if (!$vip_info) {
  207. $this->error('会员信息缺失,请联系管理员');
  208. }
  209. $_data = [];
  210. $total_amount = 0; //总价格验证
  211. $active_people = Db::name('active_people'); //报名人员表
  212. $active_people_modify = Db::name('active_people_modify'); //报名修改信息表
  213. $user_coupon = Db::name('user_coupon');
  214. foreach ($active_people_arr as $k => &$v) {
  215. $data = [];
  216. //检查信息
  217. if (!$v['name'] || iconv_strlen($v['name'], 'utf-8') > 50) {
  218. $this->error('请输入正确姓名');
  219. break;
  220. }
  221. if (iconv_strlen($v['idcard'], 'utf-8') != 18) {
  222. $this->error('请输入正确身份证号');
  223. break;
  224. }
  225. if (!is_mobile($v['mobile'])) {
  226. $this->error('请输入正确手机号');
  227. break;
  228. }
  229. if (!$v['emergencycontact'] || iconv_strlen($v['emergencycontact'], 'utf-8') > 50) {
  230. $this->error('请输入紧急联系人');
  231. break;
  232. }
  233. if (!is_mobile($v['contactmobile'])) {
  234. $this->error('请输入正确紧急联系人方式');
  235. break;
  236. }
  237. //判断是否报名过
  238. $count = $active_people->where(['active_id' => $id, 'idcard' => $v['idcard'], 'status' => ['neq', 3]])->count('id');
  239. if ($count) {
  240. $this->error($v['name'] . $v['idcard'] . '已报名过该活动');
  241. break;
  242. }
  243. $count2 = $active_people_modify->where(['active_id' => $id, 'idcard' => $v['idcard'], 'status' => 0])->count('id');
  244. if ($count2) {
  245. $this->error($v['name'] . $v['idcard'] . '已提交过修改,请等待审核');
  246. break;
  247. }
  248. //判断证件类型和保险
  249. if (!$v['credtype'] || iconv_strlen($v['credtype'], 'utf-8') > 50) {
  250. $this->error('证件类型错误');
  251. break;
  252. }
  253. if (!$v['insurance'] || iconv_strlen($v['insurance'], 'utf-8') > 50) {
  254. $this->error('保险信息错误');
  255. break;
  256. }
  257. //判断集合地点
  258. if ($v['collectionplace'] === '' || iconv_strlen($v['collectionplace'] , 'utf-8') > 255) {
  259. $this->error($v['name'] . '请选择集合地点');
  260. break;
  261. }
  262. //判断用户信息
  263. if ($v['is_self'] && $k == 0) {
  264. //判断用户信息
  265. if ($v['name'] != $this->auth->realname || $v['idcard'] != $this->auth->idcard || $v['mobile'] != $this->auth->mobile || $v['emergencycontact'] != $this->auth->emergencycontact || $v['contactmobile'] != $this->auth->contactmobile) {
  266. $this->error('本人信息错误');
  267. break;
  268. }
  269. //本人判断年龄 价格
  270. if ($info['maxage'] > 0) {
  271. $age = $this->idcardage($this->auth->idcard);
  272. if ($age < $info['minage'] || $age > $info['maxage']) {
  273. $this->error('活动年龄限制为' . $info['minage'] . '-' . $info['maxage']);
  274. break;
  275. }
  276. }
  277. if ($v['is_free'] == 1) { //使用免费次数
  278. if ($info['is_free'] != 1) {
  279. $this->error('活动暂不支持免费体验');
  280. break;
  281. }
  282. if ($this->auth->freenumber <= 0) {
  283. $this->error('您的免费次数不足');
  284. break;
  285. }
  286. //检查当月是否用过免费次数
  287. $month_time = strtotime(date('Y-m-1', time()));
  288. $count = $active_people->where(['user_id' => $this->auth->id, 'is_free' => 1, 'createtime' => ['egt', $month_time]])->count('id');
  289. if ($count) {
  290. $this->error('您当月已使用过免费次数');
  291. break;
  292. }
  293. if ($v['vipprice'] != 0 || $v['price'] != 0) {
  294. $this->error($this->auth->realname . '价格错误');
  295. break;
  296. }
  297. if ($v['coupon_id']) {
  298. $this->error('使用免费体验,无法使用优惠券');
  299. break;
  300. }
  301. } else { //不使用免费次数
  302. //会员价和优惠券是否可以叠加使用:0=否,1=是
  303. if ($info['is_overlying'] == 0 && $v['vipprice'] != $info['price'] && $v['coupon_id']) {
  304. $this->error('该活动不支持会员价和优惠券同时使用');
  305. break;
  306. }
  307. //计算会员价, 会员价优先顺序: 生日 > 女生特权日 > 会员价格
  308. $birthday = date('md', strtotime($this->auth->birthday));
  309. $now_day = date('md', $info['starttime']); //活动当天生日
  310. if ($birthday == $now_day) {
  311. //生日折扣
  312. if ($vip_info['birthdiscount'] > 100 || $vip_info['birthdiscount'] < 0) {
  313. $this->error('会员生日折扣错误,请联系管理员');
  314. break;
  315. }
  316. $discount = $vip_info['birthdiscount'];
  317. } elseif ($info['girldiscount'] < 100 && $info['girldiscount'] > 0 && $this->auth->gender == 2) {
  318. //女生特权日折扣
  319. $discount = $info['girldiscount'];
  320. } else {
  321. //会员折扣
  322. if ($vip_info['vipdiscount'] > 100 || $vip_info['vipdiscount'] < 0) {
  323. $this->error('会员折扣错误,请联系管理员');
  324. break;
  325. }
  326. $discount = $vip_info['vipdiscount'];
  327. }
  328. $vipprice = number_format($info['price'] * $discount / 100, 2, '.', ''); //会员价
  329. //查询优惠券
  330. if ($v['coupon_id']) {
  331. $user_coupon_info = $user_coupon->where(['id' => $v['coupon_id'], 'user_id' => $this->auth->id])->find();
  332. if (!$user_coupon_info) {
  333. $this->error('优惠券不存在');
  334. }
  335. if ($user_coupon_info['status'] != 0) {
  336. $this->error('优惠券已使用');
  337. }
  338. if ($user_coupon_info['endtime'] < time()) {
  339. $this->error('优惠券已过期');
  340. }
  341. if ($user_coupon_info['type'] == 1) {
  342. //打折券
  343. if ($user_coupon_info['money'] < 0 || $user_coupon_info['money'] > 100) {
  344. $this->error('优惠券折扣错误,请联系管理员');
  345. break;
  346. }
  347. } else {
  348. //抵扣券
  349. //会员价和优惠券是否可以叠加使用:0=否,1=是
  350. if ($info['is_overlying'] == 0) {
  351. if ($info['price'] < $user_coupon_info['minmoney']) {
  352. $this->error('优惠券使用条件不满足');
  353. break;
  354. }
  355. } else {
  356. if ($vipprice < $user_coupon_info['minmoney']) {
  357. $this->error('优惠券使用条件不满足');
  358. break;
  359. }
  360. }
  361. }
  362. }
  363. //判断价格
  364. //会员价和优惠券是否可以叠加使用:0=否,1=是
  365. if ($info['is_overlying'] == 0) {
  366. if ($v['coupon_id']) { //使用优惠券
  367. if ($v['vipprice'] != $info['price']) {
  368. $this->error('会员价显示错误');
  369. break;
  370. }
  371. if ($user_coupon_info['type'] == 1) {
  372. //打折券
  373. $coupon_price = number_format($info['price'] * (100 - $user_coupon_info['money']) / 100, 2, '.', '');
  374. $price = number_format($info['price'] - $coupon_price, 2, '.', '');
  375. } else {
  376. //抵扣券
  377. $price = number_format($info['price'] - $user_coupon_info['money'], 2, '.', '');
  378. }
  379. } else {
  380. $price = $vipprice;
  381. }
  382. } else {
  383. if ($vipprice != $v['vipprice']) {
  384. $this->error('会员价显示错误');
  385. break;
  386. }
  387. if ($v['coupon_id']) { //使用优惠券
  388. if ($user_coupon_info['type'] == 1) {
  389. //打折券
  390. $coupon_price = number_format($vipprice * (100 - $user_coupon_info['money']) / 100, 2, '.', '');
  391. $price = number_format($vipprice - $coupon_price, 2, '.', '');
  392. } else {
  393. //抵扣券
  394. $price = number_format($vipprice - $user_coupon_info['money'], 2, '.', '');
  395. }
  396. } else {
  397. $price = $vipprice;
  398. }
  399. }
  400. //判断小计
  401. if ($price != $v['price']) {
  402. $this->error('小计显示错误');
  403. break;
  404. }
  405. $data['vipprice'] = $v['vipprice']; //会员价
  406. $data['coupon_id'] = $v['coupon_id']; //优惠券id
  407. if ($v['coupon_id']) {
  408. $data['coupontype'] = $user_coupon_info['type'];
  409. $data['couponprice'] = $user_coupon_info['money'];
  410. }
  411. }
  412. $data['name'] = $this->auth->realname;
  413. $data['idcard'] = $this->auth->idcard;
  414. $data['mobile'] = $this->auth->mobile;
  415. $data['emergencycontact'] = $this->auth->emergencycontact;
  416. $data['contactmobile'] = $this->auth->contactmobile;
  417. } else {
  418. //帮人报名判断年龄 报名信息
  419. if ($info['maxage'] > 0) {
  420. $age = $this->idcardage($v['idcard']);
  421. if ($age < $info['minage'] || $age > $info['maxage']) {
  422. $this->error('活动年龄限制为' . $info['minage'] . '-' . $info['maxage']);
  423. break;
  424. }
  425. }
  426. //判断是否符合满几人减免一人费用
  427. //会员权限
  428. if ($vip_info['manypeople'] > 1 && $k == $vip_info['manypeople'] - 1) {
  429. if ($v['price'] != 0) {
  430. $this->error('小计显示错误');
  431. break;
  432. }
  433. } else {
  434. if ($v['price'] != $info['price']) {
  435. $this->error('小计显示错误');
  436. break;
  437. }
  438. }
  439. $data['name'] = $v['name'];
  440. $data['idcard'] = $v['idcard'];
  441. $data['mobile'] = $v['mobile'];
  442. $data['emergencycontact'] = $v['emergencycontact'];
  443. $data['contactmobile'] = $v['contactmobile'];
  444. $data['vipprice'] = $v['price']; //会员价
  445. }
  446. $data['active_id'] = $id;
  447. $data['user_id'] = $this->auth->id;
  448. $data['collectionplace'] = $v['collectionplace'];
  449. $data['credtype'] = $v['credtype'];
  450. $data['insurance'] = $v['insurance'];
  451. $data['originalprice'] = $info['price'];
  452. $data['is_free'] = $v['is_free'];
  453. $data['price'] = $v['price']; //小计
  454. $data['is_self'] = $v['is_self'];
  455. $data['createtime'] = time();
  456. array_push($_data, $data);
  457. $total_amount += $v['price'];
  458. }
  459. if ($total_amount != $total_price) {
  460. $this->error('合计价格错误');
  461. }
  462. if ($paytype == 0) { //余额支付
  463. if ($this->auth->money < $total_amount) {
  464. $this->success('您的余额不足,请先去充值', ['code' => 2]);
  465. }
  466. }
  467. //构建订单信息
  468. $order_data['order_sn'] = date('YmdHis', time()) . rand(10000000, 99999999);
  469. $order_data['active_id'] = $id;
  470. $order_data['user_id'] = $this->auth->id;
  471. // $order_data['collectionplace'] = $collectionplace;
  472. $order_data['paytype'] = $paytype;
  473. $order_data['price'] = $total_amount;
  474. $order_data['number'] = count($active_people_arr);
  475. $order_data['status'] = $paytype == 1 ? 0 : 1;
  476. $order_data['createtime'] = time();
  477. //构建活动信息
  478. $active_data['currentperson'] = $info['currentperson'] + count($active_people_arr);
  479. if ($info['currentperson'] + count($active_people_arr) >= $info['minperson'] && $info['status'] == 0) {
  480. $active_data['status'] = 1;
  481. }
  482. //开始事务
  483. Db::startTrans();
  484. //修改活动表数据
  485. $active_rs = Db::name('active')->where(['id' => $id, 'status' => $info['status'],'currentperson' => $info['currentperson']])->setField($active_data);
  486. if (!$active_rs) {
  487. Db::rollback();
  488. $this->error('网络延迟,请稍后再试');
  489. }
  490. //添加订单
  491. $rs = Db::name('active_order')->insertGetId($order_data);
  492. if (!$rs) {
  493. Db::rollback();
  494. $this->error('网络延迟,请稍后再试');
  495. }
  496. //添加人员信息
  497. foreach ($_data as &$v) {
  498. $v['order_id'] = $rs;
  499. $v['status'] = $order_data['status'];
  500. $rt = $active_people->insertGetId($v);
  501. if (!$rt) {
  502. Db::rollback();
  503. $this->error('网络延迟,请稍后再试');
  504. }
  505. }
  506. //扣除免费次数
  507. if ($info['is_free'] == 1 && $active_people_arr[0]['is_self'] == 1 && $active_people_arr[0]['is_free'] == 1) {
  508. $freenumber = $this->auth->freenumber - 1;
  509. $user_rs = Db::name('user')->where(['id' => $this->auth->id, 'freenumber' => $this->auth->freenumber])->setField('freenumber', $freenumber);
  510. if (!$user_rs) {
  511. Db::rollback();
  512. $this->error('网络延迟,请稍后再试');
  513. }
  514. }
  515. //扣除优惠券
  516. if ($active_people_arr[0]['is_self'] == 1 && $active_people_arr[0]['coupon_id']) {
  517. $user_coupon_rs = Db::name('user_coupon')->where(['id' => $active_people_arr[0]['coupon_id'], 'user_id' => $this->auth->id, 'status' => 0])->setField(['active_id' => $id, 'order_id' => $rs, 'status' => 1]);
  518. if (!$user_coupon_rs) {
  519. Db::rollback();
  520. $this->error('网络延迟,请稍后再试');
  521. }
  522. }
  523. //扣款 支付方式:0=余额,1=微信
  524. if ($paytype == 0) {
  525. $res = create_log(-$total_amount, '支付活动订单', $this->auth->id, 2, $rs);
  526. if ($res != 1) {
  527. Db::rollback();
  528. $this->error('余额资金异常,请联系管理员');
  529. }
  530. //给上级发送优惠券
  531. if ($this->auth->pre_user_id) {
  532. //查询报名活动优惠券
  533. $invite_coupon = Db::name('coupon')->where(['purpose' => 5, 'status' => 1])->order('weigh desc, id desc')->find();
  534. if ($invite_coupon) {
  535. $invite_coupon_data = [
  536. 'user_id' => $this->auth->pre_user_id,
  537. 'coupon_id' => $invite_coupon['id'],
  538. 'title' => $invite_coupon['title'],
  539. 'desc' => $invite_coupon['desc'],
  540. 'type' => $invite_coupon['type'],
  541. 'money' => $invite_coupon['money'],
  542. 'minmoney' => $invite_coupon['minmoney'],
  543. 'purpose' => $invite_coupon['purpose'],
  544. 'starttime' => time(),
  545. 'endtime' => time() + $invite_coupon['effectiveday'] * 86400,
  546. 'active_id' => $id,
  547. 'order_id' => $rs,
  548. 'createtime' => time()
  549. ];
  550. $invite_coupon_rs = Db::name('user_coupon')->insertGetId($invite_coupon_data);
  551. if (!$invite_coupon_rs) {
  552. Db::rollback();
  553. $this->error('发放优惠券失败');
  554. }
  555. }
  556. }
  557. //发送消息
  558. $data = [
  559. 'user_id' => $this->auth->id,
  560. 'type' => 1,
  561. 'title' => '活动通知',
  562. 'content' => '您已成功报名' . $info['title'] . '活动',
  563. 'createtime' => time()
  564. ];
  565. $sys_rs = Db::name('sys_msg')->insertGetId($data);
  566. if (!$sys_rs) {
  567. Db::rollback();
  568. $this->error('网络延迟,请稍后再试');
  569. }
  570. Db::commit();
  571. $this->success('报名成功');
  572. } else {
  573. //生成支付订单记录
  574. $rechar_order['user_id'] = $this->auth->id;
  575. $rechar_order['order_no'] = date('YmdHis', time()) . rand(10000000, 99999999); //微信订单编号
  576. $rechar_order['money'] = $total_amount;
  577. $rechar_order['purpose'] = 1; //充值用途:1=支付订单,2=充值,3=开通会员
  578. $rechar_order['pay_type'] = 'wechat';
  579. $rechar_order['relation_id'] = $rs;
  580. $rechar_order['createtime'] = time();
  581. $result = Db::name('rechar_order')->insertGetId($rechar_order);
  582. if (!$result) {
  583. Db::rollback();
  584. $this->error('网络延迟,请稍后再试');
  585. }
  586. Db::commit();
  587. //构建支付链接数据
  588. $wxData['body'] = '报名活动支付';
  589. $wxData['out_trade_no'] = $rechar_order['order_no'];
  590. $wxData['total_fee'] = $total_amount;
  591. // $wxData['total_fee'] = 0.01;
  592. $wxData['openid'] = $this->auth->openid;
  593. // require_once($_SERVER['DOCUMENT_ROOT'] . '/Plugins/Weixin/WxPay/WxPay.php');
  594. $wxPay = new wxpay\WxPay(config('wxchatpay'));
  595. $doResult = $wxPay->WxPayJs($wxData);
  596. $this->success('微信支付参数返回成功', $doResult);
  597. }
  598. }
  599. //根据身份证号获取年龄
  600. public function idcardage($idcard = '') {
  601. //截取身份证里的出生日期
  602. $year = substr($idcard, 6, 4);
  603. $month = substr($idcard, 10, 2);
  604. $day = substr($idcard, 12, 2);
  605. //获取当前日期
  606. $current_year = date('Y');
  607. $current_month = date('m');
  608. $current_day = date('d');
  609. //计算年龄
  610. $age = $current_year - $year;//今年减去生日年
  611. if ($month > $current_month || ($month == $current_month && $day > $current_day)) {
  612. //如果出生月大于当前月或出生月等于当前月但出生日大于当前日则减一岁
  613. $age--;
  614. }
  615. return $age;
  616. }
  617. //私人订制类型
  618. public function personaltype() {
  619. $list = Db::name('personal_type')->field('id, name')->order('weigh', 'desc')->select();
  620. $this->success('私人订制类型', $list);
  621. }
  622. //私人订制活动类型
  623. public function personalactivetype() {
  624. $list = Db::name('personal_active_type')->field('id, name')->where(['pid' => 0])->order('weigh', 'desc')->select();
  625. $list = $this->getchildtype($list);
  626. $this->success('私人订制活动类型', $list);
  627. }
  628. //无限级私人订制活动类型
  629. public function getchildtype($list = [])
  630. {
  631. $complaint_type = Db::name('personal_active_type');
  632. foreach ($list as &$v) {
  633. $child = $complaint_type->field('id, name')->where(['pid' => $v['id']])->order('weigh', 'desc')->select();
  634. if ($child) {
  635. $child = $this->getchildtype($child);
  636. }
  637. $v['child'] = $child;
  638. }
  639. return $list;
  640. }
  641. //车辆类型
  642. public function car() {
  643. $list = Db::name('car')->field('id, name, desc')->order('weigh', 'desc')->select();
  644. $this->success('车辆类型', $list);
  645. }
  646. //领队
  647. public function leader() {
  648. $list = Db::name('leader')->field('id, name')->order('weigh', 'desc')->select();
  649. $this->success('领队', $list);
  650. }
  651. //私人订制出行方向
  652. public function personaldirection() {
  653. $list = Db::name('personal_direction')->field('id, name')->order('weigh', 'desc')->select();
  654. $this->success('私人订制出行方向', $list);
  655. }
  656. //私人订制
  657. public function personalactive() {
  658. $type = input('type', '', 'trim'); //类型
  659. $number = input('number', 0, 'intval'); //出行人数
  660. $traveltime = input('traveltime', '', 'strtotime'); //出行时间
  661. $traveday = input('traveday', 0, 'intval'); //出行天数
  662. $activetype = input('activetype', '', 'trim'); //活动类型
  663. $car = input('car', '', 'trim'); //车辆
  664. $leader = input('leader', '', 'trim'); //领队
  665. $travedirection = input('travedirection', '', 'trim'); //出行方向
  666. $freerange = input('freerange', '', 'trim'); //空闲时段
  667. $remark = input('remark', '', 'trim'); //留言
  668. if (!$type || iconv_strlen($type, 'utf-8') > 50) {
  669. $this->error('请选择类型');
  670. }
  671. if ($number <= 0) {
  672. $this->error('请填写出行人数');
  673. }
  674. if ($traveltime < time()) {
  675. $this->error('请选择正确出行时间');
  676. }
  677. if ($traveday <= 0) {
  678. $this->error('请填写正确出行天数');
  679. }
  680. if (!$activetype || iconv_strlen($activetype, 'utf-8') > 50) {
  681. $this->error('请选择活动类型');
  682. }
  683. if ($car && iconv_strlen($car, 'utf-8') > 50) {
  684. $this->error('请选择车辆');
  685. }
  686. if ($leader && iconv_strlen($leader, 'utf-8') > 50) {
  687. $this->error('请选择领队');
  688. }
  689. if (!$travedirection || iconv_strlen($travedirection, 'utf-8') > 50) {
  690. $this->error('请选择出行方向');
  691. }
  692. if (!$freerange || iconv_strlen($freerange, 'utf-8') > 50) {
  693. $this->error('请选择空闲时段');
  694. }
  695. if (iconv_strlen($remark, 'utf-8') > 500) {
  696. $this->error('留言最多500字');
  697. }
  698. $data['user_id'] = $this->auth->id;
  699. $data['type'] = $type;
  700. $data['number'] = $number;
  701. $data['traveltime'] = $traveltime;
  702. $data['traveday'] = $traveday;
  703. $data['activetype'] = $activetype;
  704. $data['car'] = $car;
  705. $data['leader'] = $leader;
  706. $data['travedirection'] = $travedirection;
  707. $data['freerange'] = $freerange;
  708. $data['remark'] = $remark;
  709. $data['createtime'] = time();
  710. $rs = Db::name('personal_order')->insertGetId($data);
  711. if (!$rs) {
  712. $this->error('提交失败');
  713. }
  714. $this->success('提交成功');
  715. }
  716. //查询轮播图优惠券列表
  717. public function bannercoupon() {
  718. $list = Db::name('coupon')->field('id, title, desc, type, money')
  719. ->where(['purpose' => 4, 'status' => 1])->page($this->page, $this->pagenum)->order('weigh desc, id desc')->select();
  720. $user_coupon = Db::name('user_coupon');
  721. foreach ($list as &$v) {
  722. $v['is_receive'] = $user_coupon->where(['user_id' => $this->auth->id, 'coupon_id' => $v['id']])->count('id');
  723. }
  724. $this->success('查询轮播图优惠券列表', $list);
  725. }
  726. //领取轮播图优惠券
  727. public function receivebannercoupon() {
  728. $id = input('id', 0, 'intval'); //优惠券id
  729. if (!$id) {
  730. $this->error('参数缺失');
  731. }
  732. $info = Db::name('coupon')->where(['id' => $id, 'purpose' => 4])->find();
  733. if (!$info) {
  734. $this->error('优惠券不存在');
  735. }
  736. if ($info['status'] != 1) {
  737. $this->error('优惠券已下架');
  738. }
  739. //查询是否已领取
  740. $count = Db::name('user_coupon')->where(['user_id' => $this->auth->id, 'coupon_id' => $id])->count('id');
  741. if ($count) {
  742. $this->error('您已经领取过了');
  743. }
  744. $data['user_id'] = $this->auth->id;
  745. $data['coupon_id'] = $id;
  746. $data['title'] = $info['title'];
  747. $data['desc'] = $info['desc'];
  748. $data['type'] = $info['type'];
  749. $data['money'] = $info['money'];
  750. $data['minmoney'] = $info['minmoney'];
  751. $data['purpose'] = $info['purpose'];
  752. $data['starttime'] = time();
  753. $data['endtime'] = time() + $info['effectiveday'] * 86400;
  754. $data['createtime'] = time();
  755. //开启事务
  756. Db::startTrans();
  757. //添加领取记录
  758. $rs = Db::name('user_coupon')->insertGetId($data);
  759. if (!$rs) {
  760. Db::rollback();
  761. $this->error('领取失败');
  762. }
  763. $rt = Db::name('user_coupon')->where(['user_id' => $this->auth->id, 'coupon_id' => $id])->count('id');
  764. if ($rt != 1) {
  765. Db::rollback();
  766. $this->error('领取失败');
  767. }
  768. Db::commit();
  769. $this->success('领取成功');
  770. }
  771. //体验会员列表
  772. public function experiencevip() {
  773. $where = [];
  774. if ($this->auth->maxlevel != 5) {
  775. $where['id'] = ['neq', 5];
  776. }
  777. $list = Db::name('vip')->where(['id' => ['gt', $this->auth->maxlevel], 'status' => 1])->where($where)->select();
  778. $vip_privilege = Db::name('vip_privilege');
  779. foreach ($list as &$v) {
  780. $v['vip_privilege'] = $vip_privilege->field('id, title, desc')
  781. ->where(['vip_id' => $v['id']])->order('weigh desc')->select();
  782. }
  783. $this->success('体验会员列表', $list);
  784. }
  785. //购买体验会员
  786. public function buyexperiencevip() {
  787. //检查是否已经开通体验会员
  788. if ($this->auth->experiencetime >= time()) {
  789. $this->error('您已开通体验会员,不能重复开通');
  790. }
  791. $id = input('id', 0, 'intval');
  792. if (!$id) {
  793. $this->error('参数缺失');
  794. }
  795. $info = Db::name('vip')->where(['id' => $id])->find();
  796. if (!$info) {
  797. $this->error('会员不存在');
  798. }
  799. if ($info['status'] != 1) {
  800. $this->error('体验会员已下架');
  801. }
  802. if ($info['price'] <= 0) {
  803. $this->error('会员价格异常');
  804. }
  805. //体验会员等级必须大于成长值会员
  806. if ($id <= $this->auth->maxlevel) {
  807. $this->error('请开通更高等级体验会员');
  808. }
  809. //判断余额
  810. if ($this->auth->money < $info['price']) {
  811. $this->success('您的余额不足,请先去充值', ['code' => 2]);
  812. }
  813. $data['user_id'] = $this->auth->id;
  814. $data['vip_id'] = $id;
  815. $data['title'] = $info['title'];
  816. $data['level'] = $info['level'];
  817. $data['growthvalue'] = $info['growthvalue'];
  818. $data['free'] = $info['free'];
  819. $data['price'] = $info['price'];
  820. $data['endtime'] = time() + $info['day'] * 86400;
  821. $data['vipdiscount'] = $info['vipdiscount'];
  822. $data['birthdiscount'] = $info['birthdiscount'];
  823. $data['manypeople'] = $info['manypeople'];
  824. $data['createtime'] = time();
  825. //开启事务
  826. Db::startTrans();
  827. //添加开通记录
  828. $rs = Db::name('vip_log')->insertGetId($data);
  829. if (!$rs) {
  830. Db::rollback();
  831. $this->error('开通失败');
  832. }
  833. //扣除余额
  834. $result = create_log(-$info['price'], '开通会员', $this->auth->id, 4, $rs);
  835. if ($result != 1) {
  836. Db::rollback();
  837. $this->error('资金异常,请联系管理员');
  838. }
  839. //成长值会员信息
  840. $growth_vip_info = Db::name('vip')->find($this->auth->growthlevel);
  841. //修改用户表信息
  842. $user_data['experiencelevel'] = $id;
  843. $user_data['experiencetime'] = $data['endtime'];
  844. $user_data['maxlevel'] = $id;
  845. $freenumber = $this->auth->freenumber + $info['free'] - $growth_vip_info['free'];
  846. $user_data['freenumber'] = $freenumber > 0 ? $freenumber : 0;
  847. $rt = Db::name('user')->where([
  848. 'id' => $this->auth->id,
  849. 'experiencelevel' => $this->auth->experiencelevel,
  850. 'maxlevel' => $this->auth->maxlevel,
  851. 'freenumber' => $this->auth->freenumber])->setField($user_data);
  852. if (!$rt) {
  853. Db::rollback();
  854. $this->error('开通失败');
  855. }
  856. Db::commit();
  857. $this->success('开通成功');
  858. }
  859. //获取活动分享链接
  860. public function activelink() {
  861. $id = input('id', 0, 'intval'); //活动id
  862. if (!$id) {
  863. $this->error('参数缺失');
  864. }
  865. $info = Db::name('active')->find($id);
  866. if (!$info) {
  867. $this->error('活动不存在');
  868. }
  869. if ($info['status'] == 2) {
  870. $this->error('活动已结束');
  871. }
  872. if ($info['status'] == 3) {
  873. $this->error('活动已取消');
  874. }
  875. if ($info['showstatus'] != 1) {
  876. $this->error('活动暂时不能报名');
  877. }
  878. $access_token = Cache::get('access_token');
  879. if (!$access_token) {
  880. //获取$access_token
  881. $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.config('wxchatpay.app_id').'&secret='.config('wxchatpay.app_secret');
  882. $result = file_get_contents($url);
  883. $result = json_decode($result, true);
  884. $access_token = $result['access_token'];
  885. //缓存
  886. Cache::set('access_token', $access_token, 7000);
  887. }
  888. if (!$access_token) {
  889. $this->error('参数缺失');
  890. }
  891. $data['page_url'] = 'pages/home/detail?id='.$id.'&code='.$this->auth->invite_no;
  892. $data['page_title'] = $info['title'];
  893. $data = json_encode($data, 320);
  894. $url = 'https://api.weixin.qq.com/wxa/genwxashortlink?access_token='.$access_token;
  895. $rs = httpRequest($url, 'POST', $data);
  896. $rs = json_decode($rs, true);
  897. if ($rs['errcode'] != 0) {
  898. $this->error('网络延迟');
  899. }
  900. $this->success('分享链接', $rs['link']);
  901. }
  902. //生成小程序邀请二维码
  903. public function getqrcode($id = 0) {
  904. $access_token = Cache::get('access_token');
  905. // $access_token = '';
  906. if (!$access_token) {
  907. //获取$access_token
  908. $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.config('wxchatpay.app_id').'&secret='.config('wxchatpay.app_secret');
  909. // $url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx326ed0bf442d2773&secret=33609a3bc45bb407f0b26816158405b8';
  910. $result = file_get_contents($url);
  911. $result = json_decode($result, true);
  912. $access_token = $result['access_token'];
  913. //缓存
  914. Cache::set('access_token', $access_token, 7000);
  915. }
  916. if (!$access_token) {
  917. $this->error('参数缺失');
  918. }
  919. $data['scene'] = 'id='.$id.'&code='.$this->auth->invite_no;
  920. // $data['scene'] = 'id=AVwvR&code='.$this->auth->invite_no;
  921. $data['page'] = 'pages/home/detail';
  922. // $data['page'] = 'pages/product/product';
  923. $url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" . $access_token;
  924. $ch = curl_init($url);
  925. $timeout = 6000;
  926. curl_setopt($ch, CURLOPT_POST, 1);
  927. curl_setopt($ch, CURLOPT_HEADER, 0);
  928. curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
  929. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  930. curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
  931. curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
  932. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
  933. curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
  934. $ret = curl_exec($ch);
  935. curl_close($ch);
  936. if (is_array($ret)) {
  937. return '';
  938. }
  939. if (json_decode($ret)) {
  940. $this->error('生成失败');
  941. }
  942. $secretId = "AKIDhDTSBdoTs0rS4bx3rQijSu61f3B2cv3y"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
  943. $secretKey = "f3A1btufAOL2SbT4ORDiwtZy7yYooY1D"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
  944. $region = "ap-beijing"; //替换为用户的 region,已创建桶归属的region可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
  945. $cosClient = new Client(
  946. array(
  947. 'region' => $region,
  948. 'schema' => 'https', //协议头部,默认为http
  949. 'credentials'=> array(
  950. 'secretId' => $secretId ,
  951. 'secretKey' => $secretKey)));
  952. // $local_path = "/Users/xxx/Desktop/exampleobject.txt"; //保存到用户本地路径
  953. $path = "qrcode/"; // 二维码文件流存放位置
  954. $fileName = time() . rand(10000,99999) . ".png";
  955. $result = $cosClient->putObject(array(
  956. 'Bucket' => 'fireflytra-1309974405', //存储桶名称,由BucketName-Appid 组成,可以在COS控制台查看 https://console.cloud.tencent.com/cos5/bucket
  957. 'Key' => $path . $fileName,//'exampleobject',
  958. 'Body' => $ret,//fopen($local_path, 'rb'),
  959. ));
  960. // 请求成功
  961. return 'https://' . $result['Location'];
  962. // //上传到阿里云oss
  963. // require_once './Plugins/Aliyun/aliyun-oss-php-sdk-2.3.0/autoload.php';
  964. // require_once './Plugins/Aliyun/aliyun-oss-php-sdk-2.3.0/src/OSS/OssClient.php';
  965. // $config = C('ALIOSS_CONFIG');
  966. //
  967. // $oss = new \OSS\OssClient($config['KEY_ID'], $config['KEY_SECRET'], $config['END_POINT']);
  968. //
  969. // $path = "shopqrcode/"; // 二维码文件流存放位置
  970. // $fileName = time() . rand(10000,99999) . ".png";
  971. //
  972. // // 上传到oss
  973. // $result = $oss->putObject($config['BUCKET'], $path . $fileName, $ret);
  974. //
  975. // // 获取图片url地址
  976. // $oss_url = json_decode(json_encode($result), true);
  977. //
  978. // return $oss_url['oss-request-url'];
  979. }
  980. //生成活动海报
  981. public function activeposter() {
  982. // $poster = Db::name('poster')->find(1);
  983. // p($poster);die;
  984. $id = input('id', 0, 'intval'); //活动id
  985. if (!$id) {
  986. $this->error('参数缺失');
  987. }
  988. $info = Db::name('active')->find($id);
  989. if (!$info) {
  990. $this->error('活动不存在');
  991. }
  992. if ($info['status'] == 2) {
  993. $this->error('活动已结束');
  994. }
  995. if ($info['status'] == 3) {
  996. $this->error('活动已取消');
  997. }
  998. if ($info['showstatus'] != 1) {
  999. $this->error('活动暂时不能报名');
  1000. }
  1001. $data = [
  1002. [
  1003. "left" => "4px",
  1004. "top" => "4px",
  1005. "type" => "img",
  1006. "width" => "310px",
  1007. "height" => "235px",
  1008. "src" => one_domain_image($info['image']) //主图
  1009. ],
  1010. [
  1011. "left" => "100px",
  1012. "top" => "347px",
  1013. "type" => "img",
  1014. "width" => "115px",
  1015. "height" => "115px",
  1016. "src" => $this->getqrcode($id) //小程序二维码'https://fireflytra-1309974405.cos.ap-beijing.myqcloud.com/qrcode/165405491386733.png'
  1017. ]
  1018. ];
  1019. //处理标题字符
  1020. $child = [
  1021. "left" => "11px",
  1022. "top" => "253px",
  1023. "type" => "nickname",
  1024. "width" => "296px",
  1025. "height" => "50px",
  1026. "size" => "16px",
  1027. "color" => "#000",
  1028. "content" => mb_substr($info['title'], 0, 14)
  1029. ];
  1030. array_push($data, $child);
  1031. if (iconv_strlen($info['title'], 'utf-8') > 14) {
  1032. $child = [
  1033. "left" => "11px",
  1034. "top" => "285px",
  1035. "type" => "nickname",
  1036. "width" => "296px",
  1037. "height" => "50px",
  1038. "size" => "16px",
  1039. "color" => "#000",
  1040. "content" => mb_substr($info['title'], 14, 14)
  1041. ];
  1042. if (iconv_strlen($info['title'], 'utf-8') <= 28) {
  1043. $child['content'] = mb_substr($info['title'], 14, 14);
  1044. } else {
  1045. $child['content'] = mb_substr($info['title'], 14, 11) . '...';
  1046. }
  1047. array_push($data, $child);
  1048. }
  1049. //添加价格
  1050. $child = [
  1051. "left" => "11px",
  1052. "top" => "318px",
  1053. "type" => "nickname",
  1054. "width" => "296px",
  1055. "height" => "50px",
  1056. "size" => "16px",
  1057. "color" => "#FF0000",
  1058. "content" => $info['price'] . '元'
  1059. ];
  1060. array_push($data, $child);
  1061. $data = json_encode($data, 320);
  1062. $poster = [
  1063. 'id' => 1,
  1064. 'title' => '测试',
  1065. 'waittext' => '您的专属海报正在拼命生成中,请等待片刻...',
  1066. 'bg_image' => '/assets/img/bg.png',
  1067. 'data' => $data,
  1068. 'status' => 'normal',
  1069. 'weigh' => 0,
  1070. 'createtime' => 1653993709,
  1071. 'updatetime' => 1653994259,
  1072. ];
  1073. $image = new \addons\poster\library\Image();
  1074. $imgurl = $image->createPosterImage($poster, $this->auth->getUser());
  1075. if (!$imgurl) {
  1076. $this->error('生成海报出错');
  1077. }
  1078. $imgurl = $_SERVER["REQUEST_SCHEME"]."://".$_SERVER["HTTP_HOST"] . '/' . $imgurl;
  1079. $this->success('', $imgurl);
  1080. }
  1081. //查询帮报名过的人员信息
  1082. public function getpeopleinfo() {
  1083. $name = input('name', '', 'trim'); //名称
  1084. if (!$name) {
  1085. $this->success('信息', (object)[]);
  1086. }
  1087. $info = Db::name('active_people')->field('name, idcard, mobile, emergencycontact, contactmobile')->where(['user_id' => $this->auth->id, 'name' => $name])->find();
  1088. if (!$info) {
  1089. $info = (object)[];
  1090. }
  1091. $this->success('信息', $info);
  1092. }
  1093. ////////////////////////////////////////////////////
  1094. //视频分类列表
  1095. public function videotype() {
  1096. $type = input('type', 0, 'intval'); //分类类型:0=老年大学,1=普法课堂
  1097. if (!in_array($type, [0, 1])) {
  1098. $this->error('参数错误');
  1099. }
  1100. $list = Db::name('video_type')->field('id, name, image')->where(['type' => $type])
  1101. ->page($this->page, $this->pagenum)->order('weigh, id')->select();
  1102. $list = list_domain_image($list, ['image']);
  1103. $this->success('分类', $list);
  1104. }
  1105. //视频列表
  1106. public function video() {
  1107. $type_id = input('type_id', 0, 'intval'); //分类id
  1108. if (!$type_id) {
  1109. $this->error('您的网络开小差了~');
  1110. }
  1111. $list = Db::name('video')->field('id, title, image, is_pay')->where(['video_type_id' => $type_id, 'status' => 1, 'inject_status' => 2])->page($this->page, $this->pagenum)->order('weigh, id desc')->select();
  1112. $list = list_domain_image($list, ['image']);
  1113. $this->success('视频', $list);
  1114. }
  1115. //视频详情
  1116. public function videoinfo() {
  1117. /*$id = 0;
  1118. $session_video_id_time = Cache::get('session_video_id_time' . $this->auth->id);
  1119. if ($session_video_id_time) {
  1120. $session_video_id_time = explode('-', $session_video_id_time);
  1121. $times = $session_video_id_time[1];
  1122. if ($times > 0) {
  1123. $id = $session_video_id_time[0];
  1124. $next_times = $times - 1;
  1125. cache('session_video_id_time' . $this->auth->id, $session_video_id_time[0] . '-' . $next_times, 10);
  1126. } else {
  1127. cache('session_video_id_time' . $this->auth->id, 0, 10);
  1128. }
  1129. }
  1130. if (!$id) {*/
  1131. $id = input('id', 0, 'intval'); //视频id
  1132. // }
  1133. if (!$id) {
  1134. $this->error('您的网络开小差了');
  1135. }
  1136. $info = Db::name('video')->field('id, title, image, desc, is_pay, status, inject_status, seriesid, programid, movieid')
  1137. ->where(['id' => $id])->find();
  1138. if (!$info) {
  1139. $this->error('数据不存在');
  1140. }
  1141. if ($info['status'] != 1) {
  1142. $this->error('视频丢失');
  1143. }
  1144. if ($info['inject_status'] != 2) {
  1145. $this->error('视频丢失');
  1146. }
  1147. $info['neirong']='内容如有侵权,请联系删除';
  1148. $info['neirong1']='为您推荐';
  1149. $info['image'] = one_domain_image($info['image']);
  1150. $info['is_collection'] = Db::name('video_collection')->where(['user_id' => $this->auth->id, 'video_id' => $id])->count('id');
  1151. $this->success('详情', $info);
  1152. }
  1153. /** * * @param string $string 需要加密的字符串 * @param string $key 密钥 * @return string */
  1154. public function encrypt($string, $key) {
  1155. // $key = substr(openssl_digest(openssl_digest($key, 'sha1', true), 'sha1', true), 0, 16);
  1156. $data = openssl_encrypt($string, 'AES-128-ECB', $key, OPENSSL_RAW_DATA);
  1157. $data = bin2hex($data);
  1158. return $data;
  1159. }
  1160. /** * @param string $string 需要解密的字符串 * @param string $key 密钥 * @return string */
  1161. public function decrypt($string, $key) {
  1162. // $key = substr(openssl_digest(openssl_digest($key, 'sha1', true), 'sha1', true), 0, 16);
  1163. $decrypted = openssl_decrypt(hex2bin($string), 'AES-128-ECB', $key, OPENSSL_RAW_DATA);
  1164. return $decrypted;
  1165. }
  1166. //视频播放记录
  1167. public function playrecord() {
  1168. $id = input('id', 0, 'intval');
  1169. $total_time = input('total_time', 0, 'intval'); //总时长
  1170. $start_time = input('start_time', 0, 'intval'); //开始看时间:相对时间
  1171. $end_time = input('end_time', 0, 'intval'); //结束看时间:相对时间
  1172. $log_type = input('log_type', 'watching', 'trim'); //begin:开始播放;watching:正在播放;end:结束播放
  1173. if (!$id) {
  1174. $this->error('您的网络开小差了');
  1175. }
  1176. $info = Db::name('video')->where(['id' => $id])->find();
  1177. if (!$info) {
  1178. $this->error('数据不存在');
  1179. }
  1180. if ($info['inject_status'] != 2) {
  1181. $this->error('视频丢失');
  1182. }
  1183. $info['image'] = one_domain_image($info['image']);
  1184. $url = 'http://meta-history.unso.gitv.tv/OTT/jscmcc/addThirdPartyHistoryRecord';
  1185. $content = [
  1186. 'cpPrvdName' => '健康e家',
  1187. 'cpPrvCode' => '41000144',
  1188. 'cpPrvType' => '1006',
  1189. 'contentName' => $info['title'],
  1190. 'ChnName' => '健康',
  1191. 'ChnCode' => '1000020',
  1192. 'contentId' => (string)$info['movieid'],
  1193. 'extraContentID' => '',
  1194. 'isEffective' => $info['status'],
  1195. 'isPaid' => $info['is_pay'],
  1196. 'contentTotalTime' => $total_time,
  1197. 'startWatchTime' => $start_time,
  1198. 'endWatchTime' => $end_time,
  1199. 'playTime' => $end_time - $start_time,
  1200. 'logType' => $log_type,
  1201. 'account' => $this->encrypt($this->auth->mobile, '!@#$%^&*FJGFJT78'),
  1202. 'cpPermission' => 'GITV',
  1203. 'intent' => [
  1204. 'action' => 'com.huxiu.heh.tv.ui.splash.SplashActivity',
  1205. 'package' => 'com.huxiu.heh.tv',
  1206. 'component' => [
  1207. 'pkg' => 'com.huxiu.heh.tv',
  1208. 'cls' => 'com.huxiu.heh.tv.ui.splash.SplashActivity'
  1209. ],
  1210. 'extras' => [
  1211. /*'cmd' => '',
  1212. 'from' => '',
  1213. 'media_id' => ''*/
  1214. 'type_id' => $info['video_type_id'],
  1215. 'id' => $info['id']
  1216. ]
  1217. ],
  1218. 'imageURL' => $info['image']
  1219. ];
  1220. $content = json_encode($content, 320);
  1221. $rt = httpRequest($url, 'POST', $content);
  1222. file_put_contents('bofang.txt',$id.'_'.$rt.PHP_EOL, FILE_APPEND);
  1223. if (!$rt) {
  1224. $this->error('同步失败');
  1225. }
  1226. $rt = json_decode($rt, true);
  1227. if ($rt['code'] != 0) {
  1228. $this->error('同步失败');
  1229. }
  1230. $this->success('同步成功');
  1231. }
  1232. //视频收藏/取消收藏
  1233. public function collectionrecord() {
  1234. $id = input('id', 0, 'intval');
  1235. if (!$id) {
  1236. $this->error('您的网络开小差了');
  1237. }
  1238. $info = Db::name('video')->where(['id' => $id])->find();
  1239. if (!$info) {
  1240. $this->error('数据不存在');
  1241. }
  1242. //var_dump($info);exit;
  1243. $info['image'] = one_domain_image($info['image']);
  1244. //查询是否收藏
  1245. $count = Db::name('video_collection')->where(['user_id' => $this->auth->id, 'video_id' => $id])->count('id');
  1246. //开启事务
  1247. if ($count) {
  1248. $result = Db::name('video_collection')->where(['user_id' => $this->auth->id, 'video_id' => $id])->delete();
  1249. } else {
  1250. $result = Db::name('video_collection')->insertGetId(['user_id' => $this->auth->id, 'video_id' => $id, 'createtime' => time()]);
  1251. }
  1252. if (!$result) {
  1253. Db::rollback();
  1254. $this->error('操作失败');
  1255. }
  1256. $url = 'http://meta-history.unso.gitv.tv/OTT/jscmcc/addThirdPartyCollectionRecord';
  1257. $content = [
  1258. 'cpPrvdName' => '健康e家',
  1259. 'cpPrvCode' => '41000144',
  1260. 'cpPrvType' => '1006',
  1261. 'content' => $info['title'],
  1262. 'ChnCode' => '1000020',
  1263. 'contentId' => (string)$info['movieid'],
  1264. 'extraContentID' => '',
  1265. 'isEffective' => $info['status'],
  1266. 'isPaid' => $info['is_pay'],
  1267. 'collectionFlag' => $count ? 0 : 1,
  1268. 'account' => $this->encrypt($this->auth->mobile, '!@#$%^&*FJGFJT78'),
  1269. 'cpPermission' => 'GITV',
  1270. 'intent' => [
  1271. 'action' => 'com.huxiu.heh.tv.ui.splash.SplashActivity',
  1272. 'package' => 'com.huxiu.heh.tv',
  1273. 'component' => [
  1274. 'pkg' => 'com.huxiu.heh.tv',
  1275. 'cls' => 'com.huxiu.heh.tv.ui.splash.SplashActivity'
  1276. ],
  1277. 'extras' => [
  1278. /*'cmd' => '',
  1279. 'from' => '',
  1280. 'media_id' => ''*/
  1281. 'type_id' => $info['video_type_id'],
  1282. 'id' => $info['id']
  1283. ]
  1284. ],
  1285. 'imageURL' => $info['image']
  1286. ];
  1287. $content = json_encode($content, 320);
  1288. $rt = httpRequest($url, 'POST', $content);
  1289. file_put_contents('shoucang.txt',$id.'_'.$rt.PHP_EOL, FILE_APPEND);
  1290. if (!$rt) {
  1291. Db::rollback();
  1292. $this->error('操作失败');
  1293. }
  1294. $rt = json_decode($rt, true);
  1295. if ($rt['code'] != 0) {
  1296. Db::rollback();
  1297. $this->error('操作失败');
  1298. }
  1299. //大数据上报
  1300. $data = [
  1301. 'favid' => (string)(config('data_cp_id') . date('Ymd') . getMillisecond() . mt_rand(10000000, 99999999)),
  1302. 'UserID' => $this->auth->mobile,
  1303. 'time' => date('Y-m-d H:i:s'),
  1304. 'type' => $count ? 0 : 1,
  1305. 'cpid' => config('data_cp_id'),
  1306. 'albumid' => $id,
  1307. 'albumname' => $info['title']
  1308. ];
  1309. $data = join(json_decode('"\u0001"', true), $data);
  1310. $filename = date('Ymd').'_'.config('data_cp_id').'_userfavdata_1.dat';
  1311. $check_filename = date('Ymd').'_'.config('data_cp_id').'_userfavdata_1.chk';
  1312. error_log(print_r($data, 1) . PHP_EOL, 3, './dashuju/' . $filename);
  1313. error_log('', 3, './dashuju/' . $check_filename);
  1314. $finish_filename = date('Ymd') . '_' . config('data_cp_id') . '_userfavdata.finish';
  1315. error_log('', 3, './dashuju/' . $finish_filename);
  1316. Db::commit();
  1317. $this->success('操作成功');
  1318. }
  1319. //用户观看行为(大数据)
  1320. public function userplay() {
  1321. $id = input('id', 0, 'intval'); //视频id
  1322. $sn = input('sn', '', 'trim'); //SN号
  1323. $start_time = input('start_time', '', 'trim'); //YYYY-MM-DD HH:MM:SS(24小时制)节目开始播放时间
  1324. $end_time = input('end_time', '', 'trim'); //YYYY-MM-DD HH:MM:SS(24小时制)节目结束播放时间
  1325. $csource = input('csource', 0, ''); //1:从搜索结果访问2:从用户收藏/书签访问3:从EPG访问4:从推荐页面访问5:从猜你喜欢个性化推荐页面访问(带上推荐接口的trace_id)99:其他
  1326. $trace_id = input('trace_id', '', 'trim');
  1327. $istry = input('istry', 0, 'intval'); //0非试看 1试看
  1328. $start_posi = input('start_posi', 0, 'intval'); //播放起始点相对于影片起始点的时长,单位秒,例如从影片第 600 秒开始观看
  1329. if (!$id) {
  1330. $this->error('您的网络开小差了');
  1331. }
  1332. $info = Db::name('video')->where(['id' => $id])->find();
  1333. if (!$info) {
  1334. $this->error('数据不存在');
  1335. }
  1336. $content = [
  1337. 'playid' => (string)(config('data_cp_id') . date('Ymd') . getMillisecond() . mt_rand(10000000, 99999999)),
  1338. 'UserID' => $this->auth->mobile,
  1339. 'SN' => $sn,
  1340. 'start_time' => $start_time,
  1341. 'end_time' => $end_time,
  1342. 'service_type' => 1,
  1343. 'cpid' => config('data_cp_id'),
  1344. 'albumid' => $id,
  1345. 'albumname' => $info['title'],
  1346. 'videoid' => $id,
  1347. 'videoname' => $info['title'],
  1348. 'csource' => $csource,
  1349. 'trace_id' => $trace_id,
  1350. 'fee_type' => $info['is_pay'] == 1 ? 1 : 4,
  1351. 'istry' => $istry,
  1352. 'iscon' => 0,
  1353. 'start_posi' => $start_posi
  1354. ];
  1355. $content = join(json_decode('"\u0001"', true), $content);
  1356. $filename = date('Ymd').'_'.config('data_cp_id').'_userplaydata_1.dat';
  1357. $check_filename = date('Ymd').'_'.config('data_cp_id').'_userplaydata_1.chk';
  1358. error_log(print_r($content, 1) . PHP_EOL, 3, './dashuju/' . $filename);
  1359. error_log('', 3, './dashuju/' . $check_filename);
  1360. $finish_filename = date('Ymd') . '_' . config('data_cp_id') . '_userplaydata.finish';
  1361. error_log('', 3, './dashuju/' . $finish_filename);
  1362. $this->success('');
  1363. }
  1364. //用户行为feedback
  1365. //前端没用到,废弃
  1366. public function userfeedback() {
  1367. $type = input('type', '', 'trim'); //曝光display/播放play/点击click/订购order/搜索 search/收藏 fav
  1368. $itemid = input('itemid', '', 'trim'); //视频id,研究院推荐内容上报
  1369. $otherid = input('otherid', '', 'trim'); //视频id,非研究院推荐内容上报
  1370. $prodid = input('prodid', '', 'trim'); //订购行为必填;其余行为可选
  1371. $trace_id = input('trace_id', '', 'trim'); //大数据推荐内容有trace_id
  1372. $signal = input('signal', '', 'trim'); //所属板块编号,0异形、1头部、3电影,后续查看服务接口标识;非推荐内容所有行为为空;推荐内容所有行为必填
  1373. $pos = input('pos', '', 'trim'); //所在位置编号,从左至右第1、2…个推荐位; 非推荐内容所有行为为空;推荐内容所有行为必填
  1374. $play_duration = input('play_duration', 0, 'trim'); //单位毫秒,在播放结束时反馈该值
  1375. $url = 'http://jscp.agency.gitv.tv/v2/feedback';
  1376. $content['userid'] = $this->auth->mobile;
  1377. $content['type'] = $type;
  1378. if ($itemid) {
  1379. $content['itemid'] = config('data_cp_id') . '|' . $itemid;
  1380. }
  1381. if ($otherid) {
  1382. $content['otherid'] = config('data_cp_id') . '|' . $otherid;
  1383. }
  1384. if ($prodid) {
  1385. $content['prodid'] = $prodid;
  1386. }
  1387. if ($trace_id) {
  1388. $content['trace_id'] = 'v2_1_2_1000035_' . $this->auth->mobile . '_153672384859_123456_01';
  1389. } else {
  1390. $content['trace_id'] = '';
  1391. }
  1392. if ($signal) {
  1393. $content['signal'] = $signal;
  1394. } else {
  1395. $content['signal'] = '';
  1396. }
  1397. if ($pos) {
  1398. $content['pos'] = $pos;
  1399. } else {
  1400. $content['pos'] = '';
  1401. }
  1402. if ($play_duration) {
  1403. $content['play_duration'] = $play_duration;
  1404. } else {
  1405. $content['play_duration'] = '';
  1406. }
  1407. $content['operate_time'] = getMillisecond();
  1408. $content = http_build_query($content);
  1409. $url = $url . '?' . $content;
  1410. $rt = file_get_contents($url);
  1411. if (!$rt) {
  1412. $this->error('上报失败');
  1413. }
  1414. $this->success('上报成功');
  1415. }
  1416. //用户观看行为(支付)
  1417. public function payuserplay() {
  1418. $id = input('id', 0, 'intval'); //视频id
  1419. $sn = input('sn', '', 'trim'); //SN号
  1420. $start_time = input('start_time', '', 'trim'); //yyyymmddhhmmss (24小时制),节目开始播放时间
  1421. $end_time = input('end_time', '', 'trim'); //yyyymmddhhmmss (24小时制),节目结束播放时间,如果播放未结束,但是此时需要同步数据,填当前时间
  1422. $csource = input('csource', 0, ''); //1:从搜索结果访问2:从用户收藏/书签访问3:从EPG访问4:从推荐页面访问5、其他
  1423. if (!$id) {
  1424. $this->error('您的网络开小差了');
  1425. }
  1426. $info = Db::name('video')->where(['id' => $id])->find();
  1427. if (!$info) {
  1428. $this->error('数据不存在');
  1429. }
  1430. $content = [
  1431. 'UserID' => $this->auth->mobile,
  1432. 'city' => '14',
  1433. 'start_time' => $start_time,
  1434. 'end_time' => $end_time,
  1435. 'service_type' => 1,
  1436. 'albumid' => $id,
  1437. 'albumname' => $info['title'],
  1438. 'csource' => $csource,
  1439. 'SN' => $sn,
  1440. 'ip' => request()->ip(),
  1441. 'fee_type' => $info['is_pay'] == 1 ? 1 : '',
  1442. 'flow' => '',
  1443. 'product' => '',
  1444. 'product_name' => '',
  1445. 'info_source' => '02'
  1446. ];
  1447. $content = join('|', $content);
  1448. $filename = date('YmdH').'_'.config('cp_id').'_userviewdata_1.dat';
  1449. $check_filename = date('YmdH').'_'.config('cp_id').'_userviewdata_1.chk';
  1450. error_log(print_r($content, 1) . PHP_EOL, 3, './dashuju/' . $filename);
  1451. error_log('', 3, './dashuju/' . $check_filename);
  1452. $this->success('');
  1453. }
  1454. //首页数据范返回
  1455. public function indexdata()
  1456. {
  1457. $data = [];
  1458. $data['logo'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home/logo.webp';
  1459. $data['tuiding'] ='退订咨询';
  1460. $data['vip']='https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home/vip.webp';
  1461. $data['free']='https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home/free.webp';
  1462. $data['banner1'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fleft1.webp';
  1463. //$data['vip1'] = '0'; //字符串 0 免费
  1464. $data['banner2'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fleft2.webp';
  1465. $data['banner3'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fcenter1.webp';
  1466. $data['banner4'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fright1.webp';
  1467. $data['banner5'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fright2.webp';
  1468. $data['banner6'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fleft3.webp';
  1469. $data['banner7'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fcenter2.webp';
  1470. $data['banner8'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fcenter3.webp';
  1471. $data['banner9'] = 'https://jiankang-1304634122.cos.ap-nanjing.myqcloud.com/home%2Fright3.webp';
  1472. $data['rightcontent'] = ['服务电话:13625150009','服务时间:周一至周五8:00-18:00','收视路径:首页-应用中心-健康e家'];
  1473. $data['leftbottom'] = '内容如有侵权,请联系删除';
  1474. $data['beian']['top'] = '';
  1475. $data['beian']['bottom'] = '';
  1476. $this->success('', $data);
  1477. }
  1478. //生活服务
  1479. public function life_service() {
  1480. $list = Db::name('life_service')->field('id, name, images')->where(['status' => 1])->page($this->page, $this->pagenum)->order('weigh, id')->select();
  1481. $list = list_domain_image($list, ['images']);
  1482. if(!empty($list))
  1483. {
  1484. foreach ($list as &$key)
  1485. {
  1486. $key['bcontent'] = '本信息由"淮安天职天利家政服务有限公司"提供';
  1487. }
  1488. }
  1489. $this->success('生活服务', $list);
  1490. }
  1491. //退订服务
  1492. public function tudingc()
  1493. {
  1494. $data = ['亲爱的用户:','如果您想退订健康e家业务,可以通过以下方式:','1、电视屏 一家庭专区一个人中心-我的订单,点击退订取消订购','2、收到成功订购健康e家业务短信的1小时内,根据短信内容,发送指定数字至10086901,即可取消业务不再收取费用','3、发送0000至10086获取最新的增值业务订购信息,根据短信内容回复“业务序号”取消对应业务','4、就近的营业厅办理增值业务退订','5、拨打10086客服热线进行退订
  1495. ','6、登录中国移动网上营业厅:http://10086.cn 掌上营业厅:wap.10086.cn“已开服务一增值业务”进行退订'];
  1496. $this->success('', $data);
  1497. }
  1498. //获取特殊机型
  1499. public function special_models() {
  1500. $special_models = config('site.special_models');
  1501. $special_models = explode(',', $special_models);
  1502. $this->success('获取特殊机型', $special_models);
  1503. }
  1504. //前端报错记录
  1505. public function app_error() {
  1506. $this->success('');
  1507. }
  1508. }