|
|
@@ -6,12 +6,42 @@ use biz\ghs\classes\GhsClass;
|
|
|
use bizGhs\clear\classes\ClearClass;
|
|
|
use bizGhs\clear\services\ClearService;
|
|
|
use bizGhs\custom\classes\CustomClass;
|
|
|
+use common\components\dict;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
|
|
|
class ClearController extends BaseController
|
|
|
{
|
|
|
|
|
|
+ public function actionCancel()
|
|
|
+ {
|
|
|
+ $id = Yii::$app->request->get('id');
|
|
|
+ $clear = ClearClass::getLockById($id);
|
|
|
+ if (empty($clear)) {
|
|
|
+ util::fail('没有结账信息');
|
|
|
+ }
|
|
|
+ $ghsId = $clear->ghsId ?? 0;
|
|
|
+ $ghs = GhsClass::getById($ghsId, true);
|
|
|
+ if (empty($ghs)) {
|
|
|
+ util::fail('没有找到供应商关系');
|
|
|
+ }
|
|
|
+ if ($ghs->shopId != $this->shopId) {
|
|
|
+ util::fail('没有权限');
|
|
|
+ }
|
|
|
+ if ($clear->clearStyle != dict::getDict('clearStyle', 'gys2Hd')) {
|
|
|
+ util::fail('不是你建的账单');
|
|
|
+ }
|
|
|
+ if ($clear->status == ClearClass::STATUS_HAS_PAY) {
|
|
|
+ util::fail('账单已完成');
|
|
|
+ }
|
|
|
+ if ($clear->status == ClearClass::STATUS_EXPIRE) {
|
|
|
+ util::fail('账单已取消');
|
|
|
+ }
|
|
|
+ $clear->status = ClearClass::STATUS_EXPIRE;
|
|
|
+ $clear->save();
|
|
|
+ util::complete();
|
|
|
+ }
|
|
|
+
|
|
|
//供应商的结帐单 ssh 20210625
|
|
|
public function actionList()
|
|
|
{
|