123456789101112131415161718192021222324252627 |
- <?php
- namespace datamodel;
- use logicmodel\ChainLogic;
- use think\Log;
- class UsersGoods extends BaseDataModel
- {
- public function addHash($goodsHash){
- if(!$goodsHash){
-
- Log::error("用户商品未找到hash,{$this['id']}");
- }else {
- $this['goods_hash'] = $goodsHash['hash'];
- }
- $this['user_hash']=ChainLogic::instance()->getGoodsHash(Goods::get($this['goods_id']));
- return $this->save();
- }
- }
|