41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace app\controller\api\store;
|
|
|
|
use app\common\dao\store\consumption\StoreConsumptionDao;
|
|
use app\common\dao\store\StoreActivityUserDao;
|
|
use crmeb\basic\BaseController;
|
|
|
|
class StoreActivity extends BaseController
|
|
{
|
|
|
|
/**
|
|
* 消费金列表
|
|
* @param StoreConsumptionDao $dao
|
|
* @return mixed
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
*/
|
|
public function consumption(StoreConsumptionDao $dao)
|
|
{
|
|
$list = $dao->getValidList();
|
|
return app('json')->success($list);
|
|
}
|
|
|
|
/**
|
|
* 选择消费金类型
|
|
* @param StoreConsumptionDao $dao
|
|
* @return mixed
|
|
* @throws \Exception
|
|
*/
|
|
public function choose(StoreActivityUserDao $dao)
|
|
{
|
|
$userId = $this->request->uid();
|
|
$couponId = $this->request->post('coupon_id');
|
|
$activityId = $this->request->post('activity_id', 1);
|
|
$dao->choose($userId, $couponId, $activityId);
|
|
return app('json')->success('提交成功');
|
|
}
|
|
|
|
} |