aihelp.php 1.0 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * aihelp.php
  4. * Created by: Owen
  5. * Created on: 2020/12/5 16:16
  6. */
  7. $lid = 1;
  8. $sid = 2;
  9. define('IN_WEB', true);
  10. include(dirname(__FILE__) . "/../com.php");
  11. $aiHelpData = file_get_contents('php://input');
  12. $aiHelpData = json_decode($aiHelpData, true);
  13. if(!empty($aiHelpData)){
  14. $uid = $aiHelpData['uid'];
  15. $giftId = $aiHelpData['giftId'];
  16. $reward = json_encode(oo::commonOprModel('config')->getAIHelpConf($giftId));
  17. if(empty($reward)){
  18. die(json_encode(['flag'=>false,"data"=>""]));
  19. }
  20. $created_at = time();
  21. $expired_at = $created_at + 3*24*60*60;
  22. $remark = "AI Help 回调奖励";
  23. $tb = otable::UserGiftList();
  24. oo::commonOprDb('userinfo')->query("INSERT INTO {$tb}(uid,`from`,reward,created_at,expired_at,remark) VALUES('{$uid}', '2', '{$reward}', '{$created_at}','{$expired_at}', '{$remark}')");
  25. oo::commonOprModel('Workerman')->push($uid,ocmd::$send['User_gift'],[]);
  26. die(json_encode(['flag'=>true,"data"=>""]));
  27. }
  28. die(json_encode(['flag'=>false,"data"=>""]));