Browse Source

删除奖金设置

master
wanghongjun 3 years ago
parent
commit
d2a1b0d3ca
  1. 4
      app/controller/AdminAgentTeam.php
  2. 2
      app/controller/AdminUserTeam.php
  3. 24
      app/controller/AdminZoneManage.php
  4. 5
      app/model/ZoneGoodsParam.php
  5. 3
      app/validate/Zone.php
  6. 1
      route/app.php

4
app/controller/AdminAgentTeam.php

@ -187,6 +187,8 @@ class AdminAgentTeam extends BaseController
return $this->renderSuccess('已删除');
} catch (ValidateException $validateException) {
return $this->renderError($validateException->getMessage());
} catch (\Exception $e) {
return $this->renderError('操作失败');
}
}
@ -213,6 +215,8 @@ class AdminAgentTeam extends BaseController
return $this->renderSuccess('添加成功');
} catch (ValidateException $validateException) {
return $this->renderError($validateException->getMessage());
} catch (\Exception $e) {
return $this->renderError('操作失败');
}
}
}

2
app/controller/AdminUserTeam.php

@ -110,6 +110,8 @@ class AdminUserTeam extends BaseController
return $this->renderSuccess('已删除');
} catch (ValidateException $validateException) {
return $this->renderError($validateException->getMessage());
} catch (\Exception $e) {
return $this->renderError('操作失败');
}
}

24
app/controller/AdminZoneManage.php

@ -126,4 +126,28 @@ class AdminZoneManage extends BaseController
return $this->renderError('操作失败');
}
}
/**
* 删除奖金设置
* @return array
*/
public function goodsParamDel()
{
$param = Request::param();
try {
validate(ZoneValidate::class)->scene('goodsParamDel')->check($param);
$result = ZoneGoodsParam::destroy($param['z_g_p_id']);
if (!$result) throw new ValidateException('删除失败');
return $this->renderSuccess('已删除');
} catch (ValidateException $validateException) {
return $this->renderError($validateException->getMessage());
} catch (\Exception $e) {
return $this->renderError('操作失败');
}
}
}

5
app/model/ZoneGoodsParam.php

@ -2,10 +2,13 @@
namespace app\model;
use \think\Model;
use think\Model;
use think\model\concern\SoftDelete;
class ZoneGoodsParam extends Model
{
use SoftDelete;
protected $deleteTime = 'delete_time';
/**
* 获取刮奖参数

3
app/validate/Zone.php

@ -36,6 +36,7 @@ class Zone extends Validate
'changeStatus' => ['zone_goods_id','status'],
'goodsParamList' => ['zone_goods_id'],
'goodsParamAdd' => ['amount','probability','zone_goods_id'],
'goodsParamEdit' => ['z_g_p_id','amount','probability','zone_goods_id']
'goodsParamEdit' => ['z_g_p_id','amount','probability','zone_goods_id'],
'goodsParamDel' => ['z_g_p_id'],
];
}

1
route/app.php

@ -84,6 +84,7 @@ Route::group('adminZoneManage',function() {
Route::post('zoneGoodsChangeStatus','adminZoneManage/zoneGoodsChangeStatus')->middleware(CheckAdmin::class)->allowCrossDomain();
Route::post('goodsParamList','adminZoneManage/goodsParamList')->middleware(CheckAdmin::class)->allowCrossDomain();
Route::post('goodsParamSave','adminZoneManage/goodsParamSave')->middleware(CheckAdmin::class)->allowCrossDomain();
Route::post('goodsParamDel','adminZoneManage/goodsParamDel')->middleware(CheckAdmin::class)->allowCrossDomain();
});
# 支付(待开发)

Loading…
Cancel
Save