78 lines
2.0 KiB
PHP

<?php
namespace app\controller\api\server;
use app\common\model\store\activity\BusinessActivity;
use app\common\repositories\store\activity\ActivityRepository;
use crmeb\basic\BaseController;
class Activity extends BaseController
{
/**
* 提交活动申请
* @return mixed
* @throws \Exception
*/
public function create()
{
$param = $this->request->param();
$param['mer_id'] = $param['merId'];
$instance = ActivityRepository::instance($param['type']);
$instance->save($param);
return app('json')->success('提交成功');
}
/**
* 接受活动申请
* @return mixed
* @throws \Exception
*/
public function accept()
{
$param = $this->request->param();
$instance = ActivityRepository::instance($param['type']);
$instance->status($param['id'], BusinessActivity::STATUS_ACCEPT);
return app('json')->success('操作成功');
}
/**
* 拒绝活动申请
* @return mixed
* @throws \Exception
*/
public function refuse()
{
$param = $this->request->param();
$instance = ActivityRepository::instance($param['type']);
$instance->status($param['id'], BusinessActivity::STATUS_REFUSE);
return app('json')->success('操作成功');
}
/**
* 确认活动申请
* @return mixed
* @throws \Exception
*/
public function confirm()
{
$param = $this->request->param();
$instance = ActivityRepository::instance($param['type']);
$instance->status($param['id'], BusinessActivity::STATUS_CONFIRM);
return app('json')->success('操作成功');
}
/**
* 拒绝确认活动申请
* @return mixed
* @throws \Exception
*/
public function refuseConfirm()
{
$param = $this->request->param();
$instance = ActivityRepository::instance($param['type']);
$instance->status($param['id'], BusinessActivity::STATUS_REFUSE_CONFIRM);
return app('json')->success('操作成功');
}
}