CheckInBusiness.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\business;
  3. use Illuminate\Support\Arr;
  4. use support\Db;
  5. class CheckInBusiness
  6. {
  7. /**通过
  8. * @param $id
  9. * @return void
  10. */
  11. static public function pass($id)
  12. {
  13. try {
  14. $data=Db::table('wa_check_in')->where('id',$id)->first();
  15. if($data->status != 1){
  16. throw new \Exception('当前订单已处理!');
  17. }
  18. StreamBusiness::addStream($data->user_id,$data->money,streamType12,moldType2,moldTypefild2,$id);
  19. Db::table('wa_check_in')->where('id',$id)->update(['status'=>2]);
  20. }catch (\Throwable $exception){
  21. throw new \Exception($exception->getMessage());
  22. }
  23. }
  24. /** 驳回
  25. * @param $id
  26. * @return void
  27. * @throws \Exception
  28. */
  29. static public function reject($id)
  30. {
  31. try {
  32. $data=Db::table('wa_check_in')->where('id',$id)->first();
  33. if($data->status != 1){
  34. throw new \Exception('当前订单已处理!');
  35. }
  36. Db::table('wa_check_in')->where('id',$id)->update(['status'=>3]);
  37. }catch (\Throwable $exception){
  38. throw new \Exception($exception->getMessage());
  39. }
  40. }
  41. }