正在显示
1 个修改的文件
包含
54 行增加
和
0 行删除
| @@ -4,6 +4,7 @@ namespace App\Http\Logic\Aside\Projects; | @@ -4,6 +4,7 @@ namespace App\Http\Logic\Aside\Projects; | ||
| 4 | 4 | ||
| 5 | use App\Http\Logic\Aside\BaseLogic; | 5 | use App\Http\Logic\Aside\BaseLogic; |
| 6 | use App\Models\Projects\InquiryInfo; | 6 | use App\Models\Projects\InquiryInfo; |
| 7 | +use mysql_xdevapi\Exception; | ||
| 7 | 8 | ||
| 8 | /** | 9 | /** |
| 9 | * @remark :询盘中心 | 10 | * @remark :询盘中心 |
| @@ -35,6 +36,9 @@ class InquiryInfoLogic extends BaseLogic | @@ -35,6 +36,9 @@ class InquiryInfoLogic extends BaseLogic | ||
| 35 | if(isset($map['domain'])){ | 36 | if(isset($map['domain'])){ |
| 36 | $query = $query->where('gl_inquiry_info.domain','like','%'.$map['domain'].'%'); | 37 | $query = $query->where('gl_inquiry_info.domain','like','%'.$map['domain'].'%'); |
| 37 | } | 38 | } |
| 39 | + if(isset($map['type'])){ | ||
| 40 | + $query = $query->where('gl_inquiry_info.type',$map['type']); | ||
| 41 | + } | ||
| 38 | $lists = $query->paginate($row, $this->selectParam(), 'page', $page); | 42 | $lists = $query->paginate($row, $this->selectParam(), 'page', $page); |
| 39 | return $this->success($lists); | 43 | return $this->success($lists); |
| 40 | } | 44 | } |
| @@ -69,6 +73,56 @@ class InquiryInfoLogic extends BaseLogic | @@ -69,6 +73,56 @@ class InquiryInfoLogic extends BaseLogic | ||
| 69 | * @time :2023/7/12 9:22 | 73 | * @time :2023/7/12 9:22 |
| 70 | */ | 74 | */ |
| 71 | public function inquirySave(){ | 75 | public function inquirySave(){ |
| 76 | + try { | ||
| 77 | + $xp_id = $this->inquiryInfoSave(); | ||
| 78 | + $this->inquiryUserSave($xp_id); | ||
| 79 | + }catch (Exception $e){ | ||
| 80 | + $this->fail('error'); | ||
| 81 | + } | ||
| 82 | + return $this->success(); | ||
| 83 | + } | ||
| 72 | 84 | ||
| 85 | + /** | ||
| 86 | + * @remark :保存询盘记录表 | ||
| 87 | + * @name :inquiryInfoSave | ||
| 88 | + * @author :lyh | ||
| 89 | + * @method :post | ||
| 90 | + * @time :2023/7/12 11:12 | ||
| 91 | + */ | ||
| 92 | + public function inquiryInfoSave(){ | ||
| 93 | + //组装数据 | ||
| 94 | + $param = [ | ||
| 95 | + 'name'=>$this->param['name'], | ||
| 96 | + 'email'=>$this->param['email'], | ||
| 97 | + 'phone'=>$this->param['phone'], | ||
| 98 | + 'ip'=>$this->param['ip'], | ||
| 99 | + 'ip_area'=>$this->param['ip_area'], | ||
| 100 | + 'message'=>$this->param['message'], | ||
| 101 | + 'type'=>$this->param['type'], | ||
| 102 | + ]; | ||
| 103 | + return $this->model->insertGetId($param); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * @remark :保存询盘用户转发记录 | ||
| 108 | + * @name :inquiryInfoSave | ||
| 109 | + * @author :lyh | ||
| 110 | + * @method :post | ||
| 111 | + * @time :2023/7/12 11:12 | ||
| 112 | + */ | ||
| 113 | + public function inquiryUserSave($xp_id){ | ||
| 114 | + //组装数据 | ||
| 115 | + $param = [ | ||
| 116 | + 'user_id'=>$this->manager['id'], | ||
| 117 | + 'user_name'=>$this->manager['name'], | ||
| 118 | + 'xp_id'=>$xp_id, | ||
| 119 | + 'forward_url'=>$this->param['forward_url'], | ||
| 120 | + 'delay'=>$this->param['delay'], | ||
| 121 | + 'ip'=>$this->param['ip'], | ||
| 122 | + 'phone'=>$this->param['phone'], | ||
| 123 | + 'message'=>$this->param['message'], | ||
| 124 | + 'send_time'=>date('Y-m-d H:i:s', time()+ $this->param['delay'] * 60 * 60) | ||
| 125 | + ]; | ||
| 126 | + return $this->model->add($param); | ||
| 73 | } | 127 | } |
| 74 | } | 128 | } |
-
请 注册 或 登录 后发表评论