forked from fecshop/yii2_fecshop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurlRewrite.sh
53 lines (33 loc) · 1.4 KB
/
urlRewrite.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
Cur_Dir=$(cd `dirname $0`; pwd)
# init full search collection indexes.
$Cur_Dir/../../../../yii product/search/initindex
# get now update timestamp.
nowtime=`$Cur_Dir/../../../../yii helper/urlrewrite/nowtime`
# 1.Product 遍历所有产品,把product的url_key 写入到url rewrite
# get product all count.
count=`$Cur_Dir/../../../../yii helper/urlrewrite/productcount`
pagenum=`$Cur_Dir/../../../../yii helper/urlrewrite/productpagenum`
echo "There are $count products to process"
echo "There are $pagenum products pages to process"
echo "##############ALL BEGINING###############";
for (( i=1; i<=$pagenum; i++ ))
do
$Cur_Dir/../../../../yii helper/urlrewrite/product $i
echo "Page $i done"
done
# 2.Category 遍历所有的分类,把category的url_key 写入到 url rewrite
count=`$Cur_Dir/../../../../yii helper/urlrewrite/categorycount`
pagenum=`$Cur_Dir/../../../../yii helper/urlrewrite/categorypagenum`
echo "There are $count categorys to process"
echo "There are $pagenum categorys pages to process"
echo "##############ALL BEGINING###############";
for (( i=1; i<=$pagenum; i++ ))
do
$Cur_Dir/../../../../yii helper/urlrewrite/category $i
echo "Page $i done"
done
# delete all search data that sync_updated_at $gt $nowtime.
# $Cur_Dir/../../../../yii helper/urlrewrite/clearnoactive $nowtime
###### 1.Sync Section End
echo "##############ALL COMPLETE###############";