ExchangeOrderController.class.php
890 Bytes
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
<?php
/**
* Created by PhpStorm.
* User: liyifei2012it
* Date: 16/9/20
* Time: 13:29
*/
namespace Apicp\Controller\Attribute;
use Common\Service\AttrService;
class ExchangeOrderController extends AbstractController
{
/**
* 【通讯录】交换属性顺序接口
* @author liyifei
*/
public function Index_post()
{
// 接收参数
$attrId1 = I('post.attr_id1', 0, 'Intval');
$attrId2 = I('post.attr_id2', 0, 'Intval');
// 参数判断
if ($attrId1 == 0 || $attrId2 == 0) {
E('_ERR_ATTR_ID_IS_NULL');
return false;
}
if ($attrId1 == $attrId2) {
E('_ERR_ATTR_ID_ALIKE');
return false;
}
// 交换属性顺序
$attrServ = new AttrService();
$attrServ->exchangeOrder($attrId1, $attrId2);
return false;
}
}