Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Nov 16, 2024
1 parent a3f64ca commit 1676444
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/application/admin/controller/shop/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ public function get_specs($key = '', $ids = '')
public function delete($id)
{
$model = Db::name('product');
$result = $model->where('id', 'in', idArr($id))->update(['delete_time' => time()]);
$result = $model->where('id', 'in', idArr($id))->update(['delete_time' => time(), 'status' => 0]);
if ($result) {
user_log($this->mid, 'mark-delete-product', 1, '商品移到回收站 ' . $id, 'manager');
$this->success(lang('Delete success!'), url('shop.product/index'));
Expand All @@ -477,7 +477,7 @@ public function trash($keyword = '', $cate_id = 0)
$keyword = empty($keyword) ? "" : base64url_decode($keyword);
$model = Db::view('product', '*')
->view('productCategory', ['name' => 'category_name', 'title' => 'category_title'], 'product.cate_id=productCategory.id', 'LEFT')
->where('product.delete_time', 0);
->where('product.delete_time', '>', 0);

if (!empty($keyword)) {
$model->whereLike('product.title|productCategory.title', "%$keyword%");
Expand Down
7 changes: 1 addition & 6 deletions src/application/admin/view/shop/product/trash.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@
<span class="input-group-text">库存</span>
</span>
<span class="form-control">{$sku.storage}</span>
<span class="input-group-append">
<a href="javascript:" data-price="{$sku.price}" data-skuid="{$sku.sku_id}"
data-storage="{$sku.storage}" class="btn btn-outline-primary btn-edit-sku"><i
class="ion-md-create"></i></a>
</span>
</div>
{/foreach}
</td>
Expand All @@ -106,7 +101,7 @@
</td>
<td class="operations">
<a class="btn btn-outline-primary link-confirm" title="恢复" data-confirm="确定恢复产品上架?"
href="{:url('shop.product/trash_restore',array('id'=>$v['id']))}"><i class="ion-md-create"></i>
href="{:url('shop.product/trash_restore',array('id'=>$v['id']))}"><i class="ion-md-undo"></i>
</a>


Expand Down

0 comments on commit 1676444

Please sign in to comment.