Browse Source

checkredis

yuenan
娄梦宁 3 years ago
parent
commit
60a9726ff9
5 changed files with 15 additions and 22 deletions
  1. +4
    -4
      addons/unishop/application/admin/controller/unishop/Product.php
  2. +0
    -1
      addons/unishop/controller/Order.php
  3. +5
    -5
      application/admin/controller/unishop/Product.php
  4. +6
    -6
      application/admin/view/unishop/product/add.html
  5. +0
    -6
      application/admin/view/unishop/product/edit.html

+ 4
- 4
addons/unishop/application/admin/controller/unishop/Product.php View File

@@ -36,8 +36,8 @@ class Product extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\unishop\Product;
$servers = \app\admin\model\unishop\Config::getByName('server');
$this->assign('servers',json_decode($servers['value']));
// $servers = \app\admin\model\unishop\Config::getByName('server');
// $this->assign('servers',json_decode($servers['value']));
}


@@ -70,7 +70,7 @@ class Product extends Backend
throw new Exception('规格不能为空');
}
}
$params['server'] = implode(',',$params['server']);
// $params['server'] = implode(',',$params['server']);

$result = $this->model->allowField(true)->save($params);
Db::commit();
@@ -174,7 +174,7 @@ class Product extends Backend
}
}

$params['server'] = implode(',',$params['server']);
// $params['server'] = implode(',',$params['server']);
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {


+ 0
- 1
addons/unishop/controller/Order.php View File

@@ -158,7 +158,6 @@ class Order extends Base
'name'=>$data["name"],
'mobile'=>$data["mobile"],
'address'=>$data["address"],
'email'=>$data["email"],
"spec"=>$data["spec"],
"number"=>$data["number"],
]);


+ 5
- 5
application/admin/controller/unishop/Product.php View File

@@ -36,8 +36,8 @@ class Product extends Backend
{
parent::_initialize();
$this->model = new \app\admin\model\unishop\Product;
$servers = \app\admin\model\unishop\Config::getByName('server');
$this->assign('servers',json_decode($servers['value']));
// $servers = \app\admin\model\unishop\Config::getByName('server');
// $this->assign('servers',json_decode($servers['value']));
}


@@ -70,7 +70,7 @@ class Product extends Backend
throw new Exception('规格不能为空');
}
}
$params['server'] = implode(',',$params['server']);
// $params['server'] = implode(',',$params['server']);

$result = $this->model->allowField(true)->save($params);
Db::commit();
@@ -177,7 +177,7 @@ class Product extends Backend
}
}

$params['server'] = implode(',',$params['server']);
// $params['server'] = implode(',',$params['server']);
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
@@ -276,7 +276,7 @@ class Product extends Backend
}
}

$params['server'] = implode(',',$params['server']);
// $params['server'] = implode(',',$params['server']);
$result = $this->model->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {


+ 6
- 6
application/admin/view/unishop/product/add.html View File

@@ -123,12 +123,12 @@
<!-- name="row[delivery_id]" type="text" value="">-->
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Server')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_checkboxs('row[server][]', $servers, [], ['class'=>'form-control', 'required'=>''])}
</div>
</div>
<!-- <div class="form-group">-->
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Server')}:</label>-->
<!-- <div class="col-xs-12 col-sm-8">-->
<!-- {:build_checkboxs('row[server][]', $servers, [], ['class'=>'form-control', 'required'=>''])}-->
<!-- </div>-->
<!-- </div>-->

<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Switch')}:</label>


+ 0
- 6
application/admin/view/unishop/product/edit.html View File

@@ -122,12 +122,6 @@
<!-- </div>-->
<!-- </div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Server')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_checkboxs('row[server][]', $servers, $row.server, ['class'=>'form-control', 'required'=>''])}
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Switch')}:</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[switch]', ['1'=>__('Yes'), '0'=>__('No')], $row.switch)}


Loading…
Cancel
Save