|
|
@@ -31,6 +31,31 @@ class ItemController extends Controller
|
|
|
|
|
|
public $sjId, $shopId, $sj;
|
|
|
|
|
|
+ //拼音更新 ./yii item/update-py
|
|
|
+ public function actionUpdatePy()
|
|
|
+ {
|
|
|
+ $list = ProductClass::getAllByCondition([], null, '*', null, true);
|
|
|
+ if (!empty($list)) {
|
|
|
+ foreach ($list as $product) {
|
|
|
+ $name = $product->name;
|
|
|
+ $py = stringUtil::py($name);
|
|
|
+ $product->py = $py;
|
|
|
+ $product->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $item = PtItemClass::getAllByCondition([], null, '*', null, true);
|
|
|
+ if (!empty($item)) {
|
|
|
+ foreach ($item as $it) {
|
|
|
+ $name = $it->name;
|
|
|
+ if (!empty($name)) {
|
|
|
+ $py = stringUtil::py($name);
|
|
|
+ $it->py = $py;
|
|
|
+ $it->save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//花材反向更新 ./yii item/reverse-update
|
|
|
public function actionReverseUpdate()
|
|
|
{
|