32 lines
648 B
PHP
32 lines
648 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace app\admin\logic\goods;
|
||
|
|
|
||
|
|
use app\common\basics\Logic;
|
||
|
|
use app\common\model\goods\GoodsPrice;
|
||
|
|
|
||
|
|
class PriceLogic extends Logic
|
||
|
|
{
|
||
|
|
public static function getAllConfig()
|
||
|
|
{
|
||
|
|
return GoodsPrice::select()->toArray();
|
||
|
|
}
|
||
|
|
|
||
|
|
public static function editConfig($form)
|
||
|
|
{
|
||
|
|
if (!empty($form)) {
|
||
|
|
foreach ($form as $key => $v) {
|
||
|
|
GoodsPrice::where([
|
||
|
|
'key' => $key
|
||
|
|
])->update([
|
||
|
|
'value' => $v,
|
||
|
|
'update_time' => time()
|
||
|
|
]);
|
||
|
|
}
|
||
|
|
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|