-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shell : url rewrite script , to retry generate url rewrite and clear …
…discard rewrite url
- Loading branch information
root
authored and
root
committed
Sep 21, 2016
1 parent
273d88e
commit 5c97a57
Showing
15 changed files
with
268 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
/** | ||
* FecShop file. | ||
* | ||
* @link http://www.fecshop.com/ | ||
* @copyright Copyright (c) 2016 FecShop Software LLC | ||
* @license http://www.fecshop.com/license/ | ||
*/ | ||
?> | ||
<?php | ||
return [ | ||
'helper' => [ | ||
'class' => '\fecshop\app\console\modules\Helper\Module', | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* FecShop file. | ||
* | ||
* @link http://www.fecshop.com/ | ||
* @copyright Copyright (c) 2016 FecShop Software LLC | ||
* @license http://www.fecshop.com/license/ | ||
*/ | ||
namespace fecshop\app\console\modules\Helper; | ||
use Yii; | ||
use fecshop\app\console\modules\ConsoleModule; | ||
/** | ||
* @author Terry Zhao <[email protected]> | ||
* @since 1.0 | ||
*/ | ||
class Module extends ConsoleModule | ||
{ | ||
public $blockNamespace; | ||
public function init() | ||
{ | ||
# ÒÔÏ´úÂë±ØÐëÖ¸¶¨ | ||
$nameSpace = __NAMESPACE__; | ||
$this->controllerNamespace = $nameSpace . '\\controllers'; | ||
$this->blockNamespace = $nameSpace . '\\block'; | ||
parent::init(); | ||
|
||
} | ||
} |
99 changes: 99 additions & 0 deletions
99
app/console/modules/Helper/controllers/UrlrewriteController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
<?php | ||
/** | ||
* FecShop file. | ||
* | ||
* @link http://www.fecshop.com/ | ||
* @copyright Copyright (c) 2016 FecShop Software LLC | ||
* @license http://www.fecshop.com/license/ | ||
*/ | ||
namespace fecshop\app\console\modules\Helper\controllers; | ||
use Yii; | ||
use yii\base\InlineAction; | ||
use yii\console\Controller; | ||
/** | ||
* @author Terry Zhao <[email protected]> | ||
* @since 1.0 | ||
*/ | ||
class UrlrewriteController extends Controller | ||
{ | ||
protected $_numPerPage = 50; | ||
/** | ||
* 得到当前的时间。 | ||
*/ | ||
public function actionNowtime(){ | ||
echo time(); | ||
} | ||
|
||
/** | ||
* 得到产品的页数。 | ||
*/ | ||
public function actionProductpagenum(){ | ||
$count = Yii::$service->product->collCount($filter); | ||
echo ceil($count/$this->_numPerPage); | ||
} | ||
|
||
/** | ||
* 得到产品的总数。 | ||
*/ | ||
public function actionProductcount(){ | ||
$count = Yii::$service->product->collCount($filter); | ||
echo $count; | ||
} | ||
/** | ||
* 处理产品的重写 | ||
*/ | ||
public function actionProduct($pageNum){ | ||
$filter['numPerPage'] = $this->_numPerPage; | ||
$filter['pageNum'] = $pageNum; | ||
$filter['asArray'] = true; | ||
$products = Yii::$service->product->coll($filter); | ||
$product_ids = []; | ||
foreach($products['coll'] as $one){ | ||
Yii::$service->product->save($one); | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
/** | ||
* 得到分类的页数。 | ||
*/ | ||
public function actionCategorypagenum(){ | ||
$count = Yii::$service->category->collCount($filter); | ||
echo ceil($count/$this->_numPerPage); | ||
} | ||
|
||
/** | ||
* 得到分类的总数。 | ||
*/ | ||
public function actionCategorycount(){ | ||
$count = Yii::$service->category->collCount($filter); | ||
echo $count; | ||
} | ||
/** | ||
* 处理分类的重写 | ||
*/ | ||
public function actionCategory($pageNum){ | ||
$filter['numPerPage'] = $this->_numPerPage; | ||
$filter['pageNum'] = $pageNum; | ||
$filter['asArray'] = true; | ||
$categorys = Yii::$service->category->coll($filter); | ||
$category_ids = []; | ||
foreach($categorys['coll'] as $one){ | ||
Yii::$service->category->save($one); | ||
} | ||
|
||
} | ||
/** | ||
* 删除时间小于nowtime的 | ||
*/ | ||
public function actionClearnoactive($nowtime){ | ||
echo 'delete date gt '.$nowtime."\n"; | ||
Yii::$service->url->rewrite->removeByUpdatedAt($nowtime); | ||
} | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.