BusinessListFormatController.class.php
1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Created by PhpStorm.
* User: liyifei2012it
* Date: 18/6/19
* Time: 17:20
*/
namespace Apicp\Controller\Integral;
use Common\Common\Integral;
class BusinessListFormatController extends AbstractController
{
/**
* BusinessListFormat
* @desc 格式化策略信息
* @author liyifei
* @param String businessKey:true 业务key
* @param Array businessAct:true 行为key
* @param Array eibsIds 策略ids(自定义策略时,此参数必传)
* @param String miType:false:mi_type0 策略类型(mi_type0=积分;mi_type1=学分)
* @return array
* array(
* 'list' => array( // 策略列表
* array(
* 'businessActName' => '单课程学习', // 触发行为
* 'triggerName' => '完成', // 触发条件
* 'score' => 5, // 可获积分
* 'limitConditions' => '每日限制10次', // 限制条件(若"触发行为"相同,则该返回值仅在第一个数组中有返回)
* ),
* ),
* )
*/
public function index()
{
// 获取默认策略列表数据
$integralUtil = new Integral();
$data = $integralUtil->businessList(I('post.eibsIds'), I('post.businessKey'), I('post.miType', 'mi_type0'));
// 格式化
$formatData = $this->formatStrategyList($data);
$this->_result = $formatData;
}
}