// 8 扣除商品剩余数量
$left = $goods_model->changeLeftNumCached($goods_id, 0-$goods_num);
$ok = false;
if ($left >= 0) {
$ok = $goods_model->changeLeftNum($goods_id, 0-$goods_num);
} else {
// 扣除商品库存失败
$goods_model->changeStatusCached($goods_id, 0);
$result = array('error_no' => '108', 'error_msg' => '商品剩余数量不足');
show_result($result);
}
public function changeStatusCached($id, $status) {
$redis_obj = \common\Datasource::getRedis('instance1');
$key = 'st_g_' . $id;
return $redis_obj->set($key, $status);
}
这里我看只是扣减失败后将数据更新到了redis, 生成静态文件是怎么生成的?