作者 潘浩文
1 个管道 的构建 通过 耗费 1 秒

接口对接测试

... ... @@ -64,4 +64,112 @@ class PortalController extends Controller
Db::name('money_log')->insert(['type'=>2,'create_time'=>time(),'user_id'=>$user['id'],'money'=>$param['money'],'now_money'=>($user['money']-$param['money'])]);
$this->success('操作成功');
}
/**
* @title 订单列表种类
* @description
* @author panhaowen
* @url /portal/portal/Order
* @method POST
*/
public function Order()
{
$data=Db::name('category')->select();
$this->success('获取信息成功',$data);
}
/**
* @title 营销订单查看(审核中),营销订单修改
* @description
* @author panhaowen
* @url /portal/portal/MarketOrder1
* @method POST
* @param name:id type:int require:1 desc:营销订单id
*/
public function MarketOrder1()
{
$param=$this->request->param();
$data=cmf_get_file_download_url(Db::name('market_order')->where('id',$param['id'])->find()['more']);
$this->success('获取信息成功',$data);
}
/**
* @title 营销订单查看(已发布)
* @description
* @author panhaowen
* @url /portal/portal/MarketOrder2
* @method POST
* @param name:id type:int require:1 desc:营销订单id
*/
public function MarketOrder2()
{
$param=$this->request->param();
$data=Db::name('market_order')->where('id',$param['id'])->find();
if ($data['url']!=null) {
$this->success('获取信息成功', $data['url']);
}
$this->success('获取信息成功', cmf_get_file_download_url($data['remark']));
}
/**
* @title 营销订单重投
* @description
* @author panhaowen
* @url /portal/portal/MarketOrderRe
* @method POST
* @param name:id type:int require:1 desc:营销订单id
* @param name:file type:varchar require:1 desc:文件上传
*/
public function MarketOrderRe()
{
$param=$this->request->param();
$user=$this->getUser();
$order=Db::name('market_order')->where('id',$param['id'])->find();
if ($user['money']<$order['money']){
$this->error('账户余额不足');
}
Db::name('market_order')->insert(['market_business_id'=>$order['market_business_id'],'create_time'=>time(),'order_sn'=>cmf_get_order_sn(),'more'=>$param['file'],'money'=>$order['money'],'user_id'=>$user['id']]);
Db::name('user')->where('id',$user['id'])->setDec('money',$order['money']);
Db::name('money_log')->insert(['type'=>3,'create_time'=>time(),'user_id'=>$user['id'],'money'=>$order['money'],'now_money'=>($user['money']-$order['money'])]);
$this->success('操作成功');
}
/**
* @title 新媒体订单查看内容
* @description
* @author panhaowen
* @url /portal/portal/BusinessOrder
* @method POST
* @param name:id type:int require:1 desc:新媒体订单id
*/
public function BusinessOrder()
{
$param=$this->request->param();
$data=Db::name('business_order')->where('id',$param['id'])->find();
if ($data['post_url']!=null) {
$this->success('获取信息成功', $data['post_url']);
}
$this->success('获取信息成功', cmf_get_file_download_url($data['remark']));
}
/**
* @title 新媒体订单退款
* @description
* @author panhaowen
* @url /portal/portal/BusinessOrderReturn
* @method POST
* @param name:id type:int require:1 desc:新媒体订单id
*/
public function BusinessOrderReturn()
{
$param=$this->request->param();
$user=$this->getUser();
$order=Db::name('business_order')->where('id',$param['id'])->find();
Db::name('business_order')->where('id',$param['id'])->update(['status'=>3]);
Db::name('user')->where('id',$user)->setInc('money',$order['money']);
Db::name('money_log')->insert(['create_time'=>time(),'user_id'=>$user['id'],'money'=>$order['money'],'now_money'=>$user['money']+$order['money'],'type'=>5]);
$this->success('操作成功');
}
}
... ...