|
|
|
@ -5,6 +5,7 @@ namespace Admin\Controller;
|
|
|
|
|
use Base\Service\MendService;
|
|
|
|
|
use User\Api\UserApi as UserApi;
|
|
|
|
|
use Base\Service\PromoteService as PromoteService;
|
|
|
|
|
use Think\Model;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 后台首页控制器
|
|
|
|
@ -274,11 +275,16 @@ class MendController extends ThinkController {
|
|
|
|
|
public function cancelShift()
|
|
|
|
|
{
|
|
|
|
|
$id = I('id');
|
|
|
|
|
$status = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]);
|
|
|
|
|
if ($status) {
|
|
|
|
|
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$id,'op_name'=>'取消补链','url'=>U('Mend/shiftInfo',['id'=>$id]),'menu'=>'推广员-推广员管理-推广补链-取消补链']);
|
|
|
|
|
$model = new Model();
|
|
|
|
|
$model->startTrans();
|
|
|
|
|
|
|
|
|
|
$status1 = M('ShiftTask')->where(['id' => $id,'status' => 0])->save(['status' => 2]);
|
|
|
|
|
$status2 = M('mend', 'tab_')->where(['task_id' => $id, 'status' => 0])->save(['status' => 2, 'update_time' => time()]);
|
|
|
|
|
|
|
|
|
|
if ($status1 && $status2) {
|
|
|
|
|
$model->commit();
|
|
|
|
|
addOperationLog(['op_type'=>1,'key'=>$id,'op_name'=>'取消补链','url'=>U('Mend/shiftInfo',['id'=>$id]),'menu'=>'推广员-推广员管理-推广补链-取消补链']);
|
|
|
|
|
$this->ajaxReturn(array("status"=>1,"url"=> U('lists')));
|
|
|
|
|
} else {
|
|
|
|
|
$this->ajaxReturn(array("status"=>0,"url"=> U('lists')));
|
|
|
|
|