$skuList = ProductSkuModel::selectRaw('product_skus.id as sku_id, product_skus.code as code, product_skus.wname as sku_name, product_skus.stocks as stocks, if(`product_skus`.`status`=1,\'上架\',\'下架\') as status, brands.name as brand, product_attribute
1.定义 redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set --有序集合)和hash(哈希类型).这些数据类型都支持push/pop.add/remove及取交集并集和差集及更丰富的操作,而且这些操作都是原子性的.在此基础上,redis支持各种不同方式的排序.与memcached一样,为了保证效率,数据都是缓存在内存中.区别的是redis会周期性的
软删除及其相关实现 在模型类中要使用SoftDeletestrait并设置$date属性数组 <?php namespace App\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; class Student extends Model { use SoftDeletes; //设置表名 public $table = 'students'; //设置主键
要求: As written, each loop iteration in the LIST-SEARCH' procedure requires two tests:one for x ≠ L.nil and one for x.key ≠ k. Show how to eliminate the test forx ≠ L.nil in each iteration. 解法: 关键就是在while循环开始之前将哨兵sentinel的key值设为k,这样while循环无论链表中是否查询成功都