正在显示
1 个修改的文件
包含
48 行增加
和
0 行删除
@@ -84,6 +84,34 @@ class Store extends Api | @@ -84,6 +84,34 @@ class Store extends Api | ||
84 | } | 84 | } |
85 | 85 | ||
86 | /** | 86 | /** |
87 | + * 商务/大客户电话 | ||
88 | + * @ApiWeigh (90) | ||
89 | + * | ||
90 | + * @ApiTitle (商务/大客户电话) | ||
91 | + * @ApiSummary (商务/大客户电话) | ||
92 | + * @ApiMethod (POST) | ||
93 | + * @ApiRoute (/api/store/shangwu_phone) | ||
94 | + * @ApiReturnParams (name="code", type="integer", required=true, sample="0") | ||
95 | + * @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功") | ||
96 | + * @ApiReturn ({ | ||
97 | + 'code':'1', | ||
98 | + 'msg':'返回成功', | ||
99 | + "data": { | ||
100 | + "shangwu_phone": 电话, | ||
101 | + } | ||
102 | + }) | ||
103 | + */ | ||
104 | + public function shangwu_phone() | ||
105 | + { | ||
106 | + if($this->request->isPost()){ | ||
107 | + $return = [ | ||
108 | + 'shangwu_phone' => config('site.shangwu_phone') | ||
109 | + ]; | ||
110 | + $this->success('成功',$return); | ||
111 | + } | ||
112 | + } | ||
113 | + | ||
114 | + /** | ||
87 | * 提现规则 | 115 | * 提现规则 |
88 | * @ApiWeigh (89) | 116 | * @ApiWeigh (89) |
89 | * | 117 | * |
@@ -271,6 +299,7 @@ class Store extends Api | @@ -271,6 +299,7 @@ class Store extends Api | ||
271 | try{ | 299 | try{ |
272 | $param['user_id'] = $this->auth->id; | 300 | $param['user_id'] = $this->auth->id; |
273 | $param['original_ids'] = $param['house_ids']; | 301 | $param['original_ids'] = $param['house_ids']; |
302 | + $house_ids = $param['house_ids']; | ||
274 | $param['house_ids'] = ','.$param['house_ids'].','; | 303 | $param['house_ids'] = ','.$param['house_ids'].','; |
275 | if(!empty($param['id'])) { | 304 | if(!empty($param['id'])) { |
276 | $result = $this->store_model->edit($param); | 305 | $result = $this->store_model->edit($param); |
@@ -278,6 +307,25 @@ class Store extends Api | @@ -278,6 +307,25 @@ class Store extends Api | ||
278 | $result = $this->store_model->add($param); | 307 | $result = $this->store_model->add($param); |
279 | } | 308 | } |
280 | $id = $this->store_model->id; | 309 | $id = $this->store_model->id; |
310 | + if($param['money'] == 0) { | ||
311 | + $time = time(); | ||
312 | + foreach (explode(',',$house_ids) as $v) { | ||
313 | + // 新增社区有效期数据 | ||
314 | + $insert = [ | ||
315 | + 'user_id' => $param['user_id'], | ||
316 | + 'store_id' => $param['store_id'], | ||
317 | + 'house_id' => $v, | ||
318 | + 'start_time' => $time, | ||
319 | + 'end_time' => $time + config('site.house_valid'), | ||
320 | + 'createtime' => $time, | ||
321 | + 'updatetime' => $time | ||
322 | + ]; | ||
323 | + $result_store_house = Db::name('store_house')->insertGetId($insert); | ||
324 | + if(!$result_store_house) { | ||
325 | + Db::rollback(); | ||
326 | + } | ||
327 | + } | ||
328 | + } | ||
281 | Db::commit(); | 329 | Db::commit(); |
282 | } catch (PDOException $e) { | 330 | } catch (PDOException $e) { |
283 | Db::rollback(); | 331 | Db::rollback(); |
-
请 注册 或 登录 后发表评论