|
@@ -57,7 +57,7 @@ class Shop extends Base
|
|
|
try {
|
|
try {
|
|
|
$param = $request->post();
|
|
$param = $request->post();
|
|
|
if (!isset($param['id'])) {
|
|
if (!isset($param['id'])) {
|
|
|
- $param['agent_id'] = CodeExtend::random(16,1,date("md"));
|
|
|
|
|
|
|
+ $param['shop_id'] = CodeExtend::random(16,1,date("md"));
|
|
|
if (!empty($param['username'])) {
|
|
if (!empty($param['username'])) {
|
|
|
$userName = (new SystemUser)->where("username",$param['username'])->findOrEmpty();
|
|
$userName = (new SystemUser)->where("username",$param['username'])->findOrEmpty();
|
|
|
if (!$userName->isEmpty()) return errorTrans("error.user-exist");
|
|
if (!$userName->isEmpty()) return errorTrans("error.user-exist");
|
|
@@ -91,7 +91,7 @@ class Shop extends Base
|
|
|
if (empty($param['shop_id'])) return errorTrans("empty.require");
|
|
if (empty($param['shop_id'])) return errorTrans("empty.require");
|
|
|
$combo = (new SaasCombo)->where("id",$param['combo'])->findOrEmpty();
|
|
$combo = (new SaasCombo)->where("id",$param['combo'])->findOrEmpty();
|
|
|
if ($combo->isEmpty()) return errorTrans("empty.data");
|
|
if ($combo->isEmpty()) return errorTrans("empty.data");
|
|
|
- $shop = (new SaasAgent)->where("agent_id",$param['shop_id'])->findOrEmpty();
|
|
|
|
|
|
|
+ $shop = (new SaasShop)->where("shop_id",$param['shop_id'])->findOrEmpty();
|
|
|
if ($shop->isEmpty()) return errorTrans("empty.data");
|
|
if ($shop->isEmpty()) return errorTrans("empty.data");
|
|
|
if ($combo['unit'] == 1) { // 天
|
|
if ($combo['unit'] == 1) { // 天
|
|
|
$shop->vip_end = date('Y-m-d H:i:s',strtotime("+{$combo['time']} day"));
|
|
$shop->vip_end = date('Y-m-d H:i:s',strtotime("+{$combo['time']} day"));
|