<?php

namespace app\workerapi\controller;

use app\workerapi\lists\MasterWorkerRetentionMoneyLogLists;
use app\workerapi\logic\RetentionMoneyLogic;

class RetentionMoneyController extends BaseApiController
{
    public function totalAmount()
    {
        $result = RetentionMoneyLogic::totalAmount(['worker_id' => $this->userId]);
        if (false === $result) {
            return $this->fail(RetentionMoneyLogic::getError());
        }
        return $this->success('操作成功',$result, 1, 0);
    }

    public function lists()
    {
        return $this->dataLists(new MasterWorkerRetentionMoneyLogLists());
    }
}