作者 Cool
1 个管道 的构建 通过 耗费 1 秒

新增商务/大客户电话接口

... ... @@ -84,6 +84,34 @@ class Store extends Api
}
/**
* 商务/大客户电话
* @ApiWeigh (90)
*
* @ApiTitle (商务/大客户电话)
* @ApiSummary (商务/大客户电话)
* @ApiMethod (POST)
* @ApiRoute (/api/store/shangwu_phone)
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturn ({
'code':'1',
'msg':'返回成功',
"data": {
"shangwu_phone": 电话,
}
})
*/
public function shangwu_phone()
{
if($this->request->isPost()){
$return = [
'shangwu_phone' => config('site.shangwu_phone')
];
$this->success('成功',$return);
}
}
/**
* 提现规则
* @ApiWeigh (89)
*
... ... @@ -271,6 +299,7 @@ class Store extends Api
try{
$param['user_id'] = $this->auth->id;
$param['original_ids'] = $param['house_ids'];
$house_ids = $param['house_ids'];
$param['house_ids'] = ','.$param['house_ids'].',';
if(!empty($param['id'])) {
$result = $this->store_model->edit($param);
... ... @@ -278,6 +307,25 @@ class Store extends Api
$result = $this->store_model->add($param);
}
$id = $this->store_model->id;
if($param['money'] == 0) {
$time = time();
foreach (explode(',',$house_ids) as $v) {
// 新增社区有效期数据
$insert = [
'user_id' => $param['user_id'],
'store_id' => $param['store_id'],
'house_id' => $v,
'start_time' => $time,
'end_time' => $time + config('site.house_valid'),
'createtime' => $time,
'updatetime' => $time
];
$result_store_house = Db::name('store_house')->insertGetId($insert);
if(!$result_store_house) {
Db::rollback();
}
}
}
Db::commit();
} catch (PDOException $e) {
Db::rollback();
... ...